Trainer.save_checkpoint

Trainer.save_checkpoint(*, checkpoint_manager, score)[source]

Saves the current model and optimizer state as a checkpoint.

Parameters:
  • checkpoint_manager (CheckpointManager) – Checkpoint manager to use for saving the checkpoint.

  • score (float) – Mean score obtained on the validation set.

Returns:
str | None: Local path to the saved checkpoint directory,

or None if the checkpoint manager did not save the checkpoint.