Skip to content

early_stopping

early_stopping

Resumable early stopping callback.

ResumableEarlyStopping

Bases: EarlyStopping

EarlyStopping that ignores checkpoint state, always using config values.

Lightning restores early-stopping counters from the checkpoint, so a run that already stopped once could never be resumed past that point. Dropping the restored state lets resumed runs restart early stopping from the configured values.

load_state_dict

load_state_dict(state_dict)

Ignore restored state so resumed runs never stop on stale counters.

Source code in src/versatil/training/callbacks/early_stopping.py
def load_state_dict(self, state_dict: dict[str, Any]) -> None:
    """Ignore restored state so resumed runs never stop on stale counters."""