State¶
-
class
torchtnt.framework.state.
State
(*, entry_point: EntryPoint, timer: Optional[TimerProtocol] = None, train_state: Optional[PhaseState] = None, eval_state: Optional[PhaseState] = None, predict_state: Optional[PhaseState] = None)¶ Parent State class which can contain up to 3 instances of PhaseState, for the 3 phases. Modified by the framework, read-only for the user.
-
property
active_phase
: ActivePhase¶ Current active phase of the loop. (One of TRAIN, EVALUATE, PREDICT).
-
property
entry_point
: EntryPoint¶ Entry point used to start loop execution. (One of FIT, TRAIN, EVALUATE, PREDICT).
-
property
eval_state
: Optional[PhaseState]¶ A
PhaseState
object which contains meta information about the eval phase.
-
property
predict_state
: Optional[PhaseState]¶ A
PhaseState
object which contains meta information about the predict phase.
-
property
should_stop
: bool¶ Read-only property for whether to terminate the loop after the current step completes.
-
stop
() None ¶ Signal to the loop to end after the current step completes.
-
property
timer
: Optional[TimerProtocol]¶ A
TimerProtocol
object which can be used for debugging to record latencies of key events during loop execution.
-
property
train_state
: Optional[PhaseState]¶ A
PhaseState
object which contains meta information about the train phase.
-
property
PhaseState¶
-
class
torchtnt.framework.state.
PhaseState
(*, dataloader: Iterable[Any], max_epochs: Optional[int] = None, max_steps: Optional[int] = None, max_steps_per_epoch: Optional[int] = None, evaluate_every_n_steps: Optional[int] = None, evaluate_every_n_epochs: Optional[int] = None)¶ State for each phase (train, eval, predict). Modified by the framework, read-only for the user.
-
property
dataloader
: Iterable[Any]¶ Dataloader defined by the user.
-
property
evaluate_every_n_epochs
: Optional[int]¶ Frequency with which to evaluate in terms of training epochs, when running
fit()
. Defined by the user.
-
property
evaluate_every_n_steps
: Optional[int]¶ Frequency with which to evaluate in terms of training steps, when running
fit()
. Defined by the user.
-
property
iteration_timer
: TimerProtocol¶ An always-on
TimerProtocol
object which contains CPU timings (without synchronisation) of the iterations.
-
property
max_epochs
: Optional[int]¶ Maximum number of epochs to train, defined by the user.
-
property
max_steps
: Optional[int]¶ Maximum number of steps to train, defined by the user.
-
property
max_steps_per_epoch
: Optional[int]¶ Maximum number of steps to run per epoch, defined by the user.
-
property
step_output
: Any¶ Output of the last step.
-
property