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)
| 220 | raise NotImplementedError |
| 221 | |
| 222 | def train_one_batch(self, *input, **kwargs): |
| 223 | """Defines the computation performed in every training iteration |
| 224 | |
| 225 | Should be overridden by all subclasses. |
| 226 | |
| 227 | Args: |
| 228 | *input: the arguments of train_one_batch |
| 229 | **kwargs: the keyword arguments of train_one_batch |
| 230 | """ |
| 231 | raise NotImplementedError |
| 232 | |
| 233 | def train(self, mode=True): |
| 234 | """Set the model in evaluation mode. |