Defines the computation performed in every training iteration Should be overridden by all subclasses. Args: *input: the arguments of train_one_batch **kwargs: the keyword arguments of train_one_batch
(self, *input, **kwargs)
| 197 | raise NotImplementedError |
| 198 | |
| 199 | def train_one_batch(self, *input, **kwargs): |
| 200 | """Defines the computation performed in every training iteration |
| 201 | |
| 202 | Should be overridden by all subclasses. |
| 203 | |
| 204 | Args: |
| 205 | *input: the arguments of train_one_batch |
| 206 | **kwargs: the keyword arguments of train_one_batch |
| 207 | """ |
| 208 | raise NotImplementedError |
| 209 | |
| 210 | def train(self, mode=True): |
| 211 | """Set the model in evaluation mode. |