Interface for performing each step of a training algorithm.
| 23 | |
| 24 | |
| 25 | class Step(object): |
| 26 | """Interface for performing each step of a training algorithm.""" |
| 27 | |
| 28 | def __init__(self, distribution): |
| 29 | self._distribution = distribution |
| 30 | |
| 31 | @property |
| 32 | def distribution(self): |
| 33 | return self._distribution |
| 34 | |
| 35 | def initialize(self): |
| 36 | return [] |
| 37 | |
| 38 | def __call__(self): |
| 39 | """Perform one step of this training algorithm.""" |
| 40 | raise NotImplementedError("must be implemented in descendants") |
| 41 | |
| 42 | # TODO(priyag): Add an method to access initialization and finalize ops. |
| 43 | |
| 44 | |
| 45 | class StandardInputStep(Step): |
no outgoing calls
no test coverage detected