bob.ip.binseg.utils.checkpointer¶
Classes
|
A simple pytorch checkpointer |
-
class
bob.ip.binseg.utils.checkpointer.
Checkpointer
(model, optimizer=None, scheduler=None, path='.')[source]¶ Bases:
object
A simple pytorch checkpointer
- Parameters
model (torch.nn.Module) – Network model, eventually loaded from a checkpointed file
optimizer (
torch.optim
, Optional) – Optimizerscheduler (
torch.optim
, Optional) – Learning rate schedulerpath (
str
, Optional) – Directory where to save checkpoints.
-
load
(f=None)[source]¶ Loads model, optimizer and scheduler from file
- Parameters
f (
str
, Optional) – Name of a file (absolute or relative toself.path
), that contains the checkpoint data to load into the model, and optionally into the optimizer and the scheduler. If not specified, loads data from current path.