MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / reset

Method reset

monai/optimizers/lr_finder.py:249–254  ·  view source on GitHub ↗

Restores the model and optimizer to their initial states.

(self)

Source from the content-addressed store, hash-verified

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,

Callers 2

range_testMethod · 0.95
test_lr_finderMethod · 0.95

Calls 2

retrieveMethod · 0.80
load_state_dictMethod · 0.45

Tested by 1

test_lr_finderMethod · 0.76