|
Safemotion Lib
|
Public Member Functions | |
| __init__ (self, Any checkpointer, int period, int max_iter=None) | |
| step (self, int iteration, **Any kwargs) | |
| save (self, str name, **Any kwargs) | |
Public Attributes | |
| checkpointer | |
| period | |
| max_iter | |
Save checkpoints periodically. When `.step(iteration)` is called, it will execute `checkpointer.save` on the given checkpointer, if iteration is a multiple of period or if `max_iter` is reached.
Definition at line 251 of file checkpoint.py.
| fastreid.utils.checkpoint.PeriodicCheckpointer.__init__ | ( | self, | |
| Any | checkpointer, | ||
| int | period, | ||
| int | max_iter = None ) |
Args:
checkpointer (Any): the checkpointer object used to save
checkpoints.
period (int): the period to save checkpoint.
max_iter (int): maximum number of iterations. When it is reached,
a checkpoint named "model_final" will be saved.
Definition at line 258 of file checkpoint.py.
| fastreid.utils.checkpoint.PeriodicCheckpointer.save | ( | self, | |
| str | name, | ||
| **Any | kwargs ) |
Same argument as :meth:`Checkpointer.save`.
Use this method to manually save checkpoints outside the schedule.
Args:
name (str): file name.
kwargs (Any): extra data to save, same as in
:meth:`Checkpointer.save`.
Definition at line 289 of file checkpoint.py.
| fastreid.utils.checkpoint.PeriodicCheckpointer.step | ( | self, | |
| int | iteration, | ||
| **Any | kwargs ) |
Perform the appropriate action at the given iteration.
Args:
iteration (int): the current iteration, ranged in [0, max_iter-1].
kwargs (Any): extra data to save, same as in
:meth:`Checkpointer.save`.
Definition at line 271 of file checkpoint.py.
| fastreid.utils.checkpoint.PeriodicCheckpointer.checkpointer |
Definition at line 267 of file checkpoint.py.
| fastreid.utils.checkpoint.PeriodicCheckpointer.max_iter |
Definition at line 269 of file checkpoint.py.
| fastreid.utils.checkpoint.PeriodicCheckpointer.period |
Definition at line 268 of file checkpoint.py.