Skip to content

.state()

Return the full optimizer state, including hyperparameters and moment estimates.

The returned dict contains enough information to resume training from an exact checkpoint. Moment arrays are nested inside each group entry so the structure mirrors param_groups.

Returns:

  • dict

    Dict with step_count and a param_groups list. Each group

  • dict

    entry contains its label, hyperparameters (lr, beta_1,

  • dict

    beta_2, eps), and moments1 / moments2 dicts mapping

  • dict

    parameter names to their current first and second moment arrays.