Skip to content

.state()

Return the full optimizer state, including hyperparameters and velocities.

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

Returns:

  • dict

    Dict with step_count and a param_groups list.

  • dict

    Each group entry contains its label, hyperparameters (lr,momentum, dampening),

  • dict

    and a velocities dict mapping parameter names to their current velocity arrays.