EvSys

LoopState

Live training-loop context handed to every callback hook.

The fields are mutated in-place by the loop as the run progresses; step advances every iteration, stop_requested flips when a callback calls :meth:request_stop. Other fields are immutable for the run's lifetime.

Attributes

attributestepint

Current step index (0-based). Advances per iteration.

attributenum_stepsint
attributeoutput_dirPath
attributebackend'Backend'
attributelog_storeAny

The same log_store the loop writes to. Callbacks can also write auxiliary rows (e.g. log_metrics(\{"debug/x": 1\}, step=...)).

attributecheckpoint_mgr'CheckpointManager'
attributestop_requestedbool
= False
attributectx'LogContext | None'
= None

The experiment-wide :class:LogContext (shared with the Experiment-scope hooks). None for a bare run_experiment with no Experiment driving it; populated when the Experiment threads callbacks into the loop.

Functions

funcrequest_stop(self) -> None

Signal the loop to break after the current step completes.

Used by EarlyStoppingCallback and similar policies. The loop honours it at the top of the next iteration so the current step's writes flush cleanly first.

paramself

Returns

None
func__init__(self, step, num_steps, output_dir, backend, log_store, checkpoint_mgr, stop_requested=False, ctx=None) -> None
paramself
paramstepint
paramnum_stepsint
paramoutput_dirPath
parambackend'Backend'
paramlog_storeAny
paramcheckpoint_mgr'CheckpointManager'
paramstop_requestedbool
= False
paramctx'LogContext | None'
= None

Returns

None

On this page