checkpointer.Checkpointer
Class Checkpointer
Class for managing checkpoints for Dopamine agents.
Methods
init
__init__(
base_directory,
checkpoint_file_prefix='ckpt',
checkpoint_frequency=1
)
Initializes Checkpointer.
Args:
base_directory
: str, directory where all checkpoints are
saved/loaded.checkpoint_file_prefix
: str, prefix to use for naming checkpoint
files.checkpoint_frequency
: int, the frequency at which to checkpoint.
Raises:
ValueError
: if base_directory is empty, or not creatable.
load_checkpoint
load_checkpoint(iteration_number)
Tries to reload a checkpoint at the selected iteration number.
Args:
iteration_number
: The checkpoint iteration number to try to load.
Returns:
If the checkpoint files exist, two unpickled objects that were passed in as data
to save_checkpoint; returns None if the files do not exist.
save_checkpoint
save_checkpoint(
iteration_number,
data
)
Saves a new checkpoint at the current iteration_number.
Args:
iteration_number
: int, the current iteration number for this
checkpoint.data
: Any (picklable) python object containing the data to store in
the checkpoint.