Restores the model and optimizer to their initial states.
(self)
| 247 | self.device = device if device else self.model_device |
| 248 | |
| 249 | def reset(self) -> None: |
| 250 | """Restores the model and optimizer to their initial states.""" |
| 251 | |
| 252 | self.model.load_state_dict(self.state_cacher.retrieve("model")) |
| 253 | self.optimizer.load_state_dict(self.state_cacher.retrieve("optimizer")) |
| 254 | self.model.to(self.model_device) |
| 255 | |
| 256 | def range_test( |
| 257 | self, |