State¶
-
class
ignite.engine.events.
State
(**kwargs)[source]¶ An object that is used to pass internal and user-defined state between event handlers. By default, state contains the following attributes:
state.iteration # 1-based, the first iteration is 1 state.epoch # 1-based, the first epoch is 1 state.seed # seed to set at each epoch state.dataloader # data passed to engine state.epoch_length # optional length of an epoch state.max_epochs # number of epochs to run state.max_iters # number of iterations to run state.batch # batch passed to `process_function` state.output # output of `process_function` after a single iteration state.metrics # dictionary with defined metrics if any state.times # dictionary with total and per-epoch times fetched on # keys: Events.EPOCH_COMPLETED.name and Events.COMPLETED.name
- Parameters
kwargs (Any) – keyword arguments to be defined as State attributes.
- Return type
Methods
Get the value of Event attribute with given event_name.
-
get_event_attrib_value
(event_name)[source]¶ Get the value of Event attribute with given event_name.
- Parameters
event_name (Union[str, ignite.engine.events.Events, ignite.engine.events.CallableEventWithFilter]) –
- Return type