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