checkpointer.Checkpointer

Class Checkpointer

Class for managing checkpoints for Dopamine agents.

Methods

init

  1. __init__(
  2. base_directory,
  3. checkpoint_file_prefix='ckpt',
  4. checkpoint_frequency=1
  5. )

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

  1. 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

  1. save_checkpoint(
  2. iteration_number,
  3. data
  4. )

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.