TrainerState

Contents

TrainerState#

class braintools.trainer.TrainerState#

Container for trainer state during training.

Variables:
  • epoch (int) – Current epoch.

  • global_step (int) – Number of optimizer steps taken. With accumulate_grad_batches=k one step spans k training batches.

  • stage (str) – Current stage (‘train’, ‘validate’, ‘test’, ‘predict’).

  • lr_schedulers_stepped (bool) – Whether the epoch-wise learning-rate schedulers have already been stepped for the current epoch. Saved in checkpoints so a resume knows whether the schedule still has to advance past the checkpoint’s epoch.