Shortcuts

framework.framework

class ignite_framework.framework.framework.Configurations[source]

Any configuration applied to the code before starting the engines. This can be simple parameter switches that change from their initialization value to their run value, e.g. turning on the event trigger mode of all StateVariables from ‘False’ to ‘True’ just before starting the engines. But configurations can also mean completely rewriting the complete code into highly efficient for-loops or into code compatible for distributed parallel cloud-computing.

__getattr__(name)

A smart getter for getting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_started
False
>>> state.state_run_started
False
>>> id(state.engines.state_status.state_run_started) == id(state.state_run_started)
Parameters:name (str) – state container name or state object name

Returns:

__setattr__(name, value)

A smart setter for setting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_completed = True
>>> state.engines.state_status.state_run_completed
True
>>> state.state_run_compelted = False
>>> state.engines.state_status.state_run_completed
False

Note

Performance

The __setattr__ of a state container is only used during state initialization, not during training. Therefore the setting-performance is of lower relevance.

__weakref__

list of weak references to the object (if defined)

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

integrate_new_state_component_class(component_class, integrated_attrs_args_dict={})
Integrate new state component class, e.g. PyTorch torch.nn.NewModule, or append additional/change existing
integrated attributes to/of existing state component class.
Parameters:
  • self
  • component_class – class of the new state component to be integrated
  • integrated_attrs_args_dict (dict) –
    dict(<attr_name>=(<bso_class>, <initial_value>, <component_attr_getter>,
    <component_attr_setter>))
  • attr__get__ – function that is forwarded to instance__get__ of BaseStateObject
  • attr__set__ – function that is forwarded to instance__set__ of BaseStateObject

Returns:

register_user_defined_ctrID_class(id_class)

Add/Register a new container-ID-class to a state cotnainer, e.g. a special tokenizer class to state.modules.

As soon as the new ID-class is registered at the state container, instances of this ID-class (or subclasses of the ID-class) can be set a s container attribute.

Parameters:
  • self – state container, e.g. state.modules, state.optimizer, etc.
  • id_class – a class from which a instance of this class the user wnats to attach to the state container

Returns:

class ignite_framework.framework.framework.ConfigurationsStatus(name)[source]

Trigger for all configuration work.

_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.DataLoaders[source]

Container for all dataloaders.

__getattr__(name)

A smart getter for getting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_started
False
>>> state.state_run_started
False
>>> id(state.engines.state_status.state_run_started) == id(state.state_run_started)
Parameters:name (str) – state container name or state object name

Returns:

__setattr__(name, value)

A smart setter for setting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_completed = True
>>> state.engines.state_status.state_run_completed
True
>>> state.state_run_compelted = False
>>> state.engines.state_status.state_run_completed
False

Note

Performance

The __setattr__ of a state container is only used during state initialization, not during training. Therefore the setting-performance is of lower relevance.

__weakref__

list of weak references to the object (if defined)

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

integrate_new_state_component_class(component_class, integrated_attrs_args_dict={})
Integrate new state component class, e.g. PyTorch torch.nn.NewModule, or append additional/change existing
integrated attributes to/of existing state component class.
Parameters:
  • self
  • component_class – class of the new state component to be integrated
  • integrated_attrs_args_dict (dict) –
    dict(<attr_name>=(<bso_class>, <initial_value>, <component_attr_getter>,
    <component_attr_setter>))
  • attr__get__ – function that is forwarded to instance__get__ of BaseStateObject
  • attr__set__ – function that is forwarded to instance__set__ of BaseStateObject

Returns:

register_user_defined_ctrID_class(id_class)

Add/Register a new container-ID-class to a state cotnainer, e.g. a special tokenizer class to state.modules.

As soon as the new ID-class is registered at the state container, instances of this ID-class (or subclasses of the ID-class) can be set a s container attribute.

Parameters:
  • self – state container, e.g. state.modules, state.optimizer, etc.
  • id_class – a class from which a instance of this class the user wnats to attach to the state container

Returns:

class ignite_framework.framework.framework.Engines[source]

Container for all

__getattr__(name)

A smart getter for getting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_started
False
>>> state.state_run_started
False
>>> id(state.engines.state_status.state_run_started) == id(state.state_run_started)
Parameters:name (str) – state container name or state object name

Returns:

__setattr__(name, value)

A smart setter for setting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_completed = True
>>> state.engines.state_status.state_run_completed
True
>>> state.state_run_compelted = False
>>> state.engines.state_status.state_run_completed
False

Note

Performance

The __setattr__ of a state container is only used during state initialization, not during training. Therefore the setting-performance is of lower relevance.

__weakref__

list of weak references to the object (if defined)

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

integrate_new_state_component_class(component_class, integrated_attrs_args_dict={})
Integrate new state component class, e.g. PyTorch torch.nn.NewModule, or append additional/change existing
integrated attributes to/of existing state component class.
Parameters:
  • self
  • component_class – class of the new state component to be integrated
  • integrated_attrs_args_dict (dict) –
    dict(<attr_name>=(<bso_class>, <initial_value>, <component_attr_getter>,
    <component_attr_setter>))
  • attr__get__ – function that is forwarded to instance__get__ of BaseStateObject
  • attr__set__ – function that is forwarded to instance__set__ of BaseStateObject

Returns:

register_user_defined_ctrID_class(id_class)

Add/Register a new container-ID-class to a state cotnainer, e.g. a special tokenizer class to state.modules.

As soon as the new ID-class is registered at the state container, instances of this ID-class (or subclasses of the ID-class) can be set a s container attribute.

Parameters:
  • self – state container, e.g. state.modules, state.optimizer, etc.
  • id_class – a class from which a instance of this class the user wnats to attach to the state container

Returns:

class ignite_framework.framework.framework.FrameBaseTransition(name)[source]

Make FrameBaseTransition.__init__() that will instantiate the descriptors. Any subclasses with its own __init__() must call super().__init__(name).

_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.FrameChart(name)[source]

Framework class of any tensorboard chart.

_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.FrameChartsComposition(name)[source]
_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.FrameConditionalCounter(name, conditional_value_ref, threshold_or_num_calls, caller_refs='', min_or_max='max')[source]
__init__(name, conditional_value_ref, threshold_or_num_calls, caller_refs='', min_or_max='max')[source]

Initialize self. See help(type(self)) for accurate signature.

condition()[source]

” Modify set.conditional_set_value based on user conditions. For triggering the callbacks list of the state variable ‘self.n_conditional_counts` the self.conditional_set_value has to be increased by ‘+1`.

class ignite_framework.framework.framework.FrameEngine(name)[source]

Make BaseEngine.__init__() that will instantiate the descriptors. Any subclasses with its own __init__() must call super().__init__(name).

_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.FrameLogger(name)[source]
_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.FrameMaintainer(name)[source]

Make BaseTransition.__init__() that will instantiate the descriptors. Any subclasses with its own __init__() must call super().__init__(name).

_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.FrameMaintainerMetric(name)[source]

Metric of infrastructure resources.

_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.FrameMetric(name)[source]
_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.FrameOutputHandler(name)[source]

Base class of any output handler.

Output handlers are used when certain output transformation are required by multiple transitions or metrics. This way repeated calculations of the same output transformation which perhaps may me very costly can be avoided.

_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

static _transform_input(value)

Abstract static method to transfrom the __set__ value before assigning it.

If _transform_input is not overriden by a subclass :param value:

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.FramePipeline(name)[source]
_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.FrameTensorboard(name)[source]
_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.Loggers[source]

Container for all loggers despite tensorboard.

__getattr__(name)

A smart getter for getting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_started
False
>>> state.state_run_started
False
>>> id(state.engines.state_status.state_run_started) == id(state.state_run_started)
Parameters:name (str) – state container name or state object name

Returns:

__setattr__(name, value)

A smart setter for setting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_completed = True
>>> state.engines.state_status.state_run_completed
True
>>> state.state_run_compelted = False
>>> state.engines.state_status.state_run_completed
False

Note

Performance

The __setattr__ of a state container is only used during state initialization, not during training. Therefore the setting-performance is of lower relevance.

__weakref__

list of weak references to the object (if defined)

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

integrate_new_state_component_class(component_class, integrated_attrs_args_dict={})
Integrate new state component class, e.g. PyTorch torch.nn.NewModule, or append additional/change existing
integrated attributes to/of existing state component class.
Parameters:
  • self
  • component_class – class of the new state component to be integrated
  • integrated_attrs_args_dict (dict) –
    dict(<attr_name>=(<bso_class>, <initial_value>, <component_attr_getter>,
    <component_attr_setter>))
  • attr__get__ – function that is forwarded to instance__get__ of BaseStateObject
  • attr__set__ – function that is forwarded to instance__set__ of BaseStateObject

Returns:

register_user_defined_ctrID_class(id_class)

Add/Register a new container-ID-class to a state cotnainer, e.g. a special tokenizer class to state.modules.

As soon as the new ID-class is registered at the state container, instances of this ID-class (or subclasses of the ID-class) can be set a s container attribute.

Parameters:
  • self – state container, e.g. state.modules, state.optimizer, etc.
  • id_class – a class from which a instance of this class the user wnats to attach to the state container

Returns:

class ignite_framework.framework.framework.LoggersStatus(name)[source]
_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.Maintenance[source]

Any maintainance/debugging/re-configuration processed after “starting the engines” and may also be periodically repeated, e.g.: - all loggers DESPITE tensorboard loggers - after each epoch some kind of memory cleanups, etc.. - search tools fo return e.g. at which events a certain function/method is callbacked - list all callbacks of all state variables

__getattr__(name)

A smart getter for getting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_started
False
>>> state.state_run_started
False
>>> id(state.engines.state_status.state_run_started) == id(state.state_run_started)
Parameters:name (str) – state container name or state object name

Returns:

__setattr__(name, value)

A smart setter for setting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_completed = True
>>> state.engines.state_status.state_run_completed
True
>>> state.state_run_compelted = False
>>> state.engines.state_status.state_run_completed
False

Note

Performance

The __setattr__ of a state container is only used during state initialization, not during training. Therefore the setting-performance is of lower relevance.

__weakref__

list of weak references to the object (if defined)

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

integrate_new_state_component_class(component_class, integrated_attrs_args_dict={})
Integrate new state component class, e.g. PyTorch torch.nn.NewModule, or append additional/change existing
integrated attributes to/of existing state component class.
Parameters:
  • self
  • component_class – class of the new state component to be integrated
  • integrated_attrs_args_dict (dict) –
    dict(<attr_name>=(<bso_class>, <initial_value>, <component_attr_getter>,
    <component_attr_setter>))
  • attr__get__ – function that is forwarded to instance__get__ of BaseStateObject
  • attr__set__ – function that is forwarded to instance__set__ of BaseStateObject

Returns:

register_user_defined_ctrID_class(id_class)

Add/Register a new container-ID-class to a state cotnainer, e.g. a special tokenizer class to state.modules.

As soon as the new ID-class is registered at the state container, instances of this ID-class (or subclasses of the ID-class) can be set a s container attribute.

Parameters:
  • self – state container, e.g. state.modules, state.optimizer, etc.
  • id_class – a class from which a instance of this class the user wnats to attach to the state container

Returns:

class ignite_framework.framework.framework.MaintenanceStatus(name)[source]
_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.MetaBaseTransitionsContainer(name, bases, namespace, **kwargs)[source]

The special containers (e.g. DataLoaders, Modules, etc.) are directly derived herefrom with a defining a BaseStateContainer in between for 2 reasons: 1. no container specific __init__() method is required 2. pure framework subclasses, so no feature developer interface BaseStateContainer is required

class ignite_framework.framework.framework.MetaEngine[source]

Define the St

static __new__(typ, cls_name, bases, namespace)[source]

Create and return a new object. See help(type) for accurate signature.

class ignite_framework.framework.framework.MetaEnteredFrameStateObjectContainer[source]

Metaclass to create new classes with user defined frame state objects at runtime.

static __new__(typ, cls_name, bases, namespace, entered_namespace, default_attr_fso_cls, ctr)[source]

Create and return a new object. See help(type) for accurate signature.

class ignite_framework.framework.framework.MetaParametersContainer(name, bases, namespace, **kwargs)[source]
static __new__(typ, cls_name, bases, namespace, containing_name, containing_types)[source]

Create and return a new object. See help(type) for accurate signature.

class ignite_framework.framework.framework.MetaState(name, bases, namespace, **kwargs)[source]

Singleton Metaclass from which all meta state containers inherit.

static __new__(typ, name, bases, namespace)[source]

Create and return a new object. See help(type) for accurate signature.

class ignite_framework.framework.framework.MetaStateComponent[source]

Metaclass of wrapper class integrating PyTorch object (e.g. DataLoader()s, Module()s, Optimizer()s, etc.) into state.

When assigning a PyTorch object to the state this object is wrapped into a subclass of BaseStateComponent which integrates all its relevant parameters and variables into state to expose (make them available) to the user. For example, when the trainer’s dataloader trainer_dataloader = DataLoader(…) is assigned to state.dataloaders.trainer_dataloader = trainer_dataloader, the batch size of the dataloader should be integrated as a StateParameter which will make it available as hyperparameter in state.params.dataloaders.trainer_dataloader_batch_size (shortcut: state.trainer_dataloader_batch_size) with all the functionalities like suffix overloading & callbakcks.

static __new__(typ, cls_name, bases, namespace, component_obj, ctr)[source]

Create and return a new object. See help(type) for accurate signature.

class ignite_framework.framework.framework.MetaStateComponentsContainer(name, bases, namespace, **kwargs)[source]
static __new__(typ, cls_name, bases, namespace, containing_name, containing_types)[source]

Create and return a new object. See help(type) for accurate signature.

class ignite_framework.framework.framework.MetaStateContainer(name, bases, namespace, **kwargs)[source]
static __new__(typ, cls_name, bases, namespace, containing_name: str, containing_types)[source]

Create and return a new object. See help(type) for accurate signature.

class ignite_framework.framework.framework.MetaValuesContainer(name, bases, namespace, **kwargs)[source]
static __new__(typ, cls_name, bases, namespace, containing_name, containing_types)[source]

Create and return a new object. See help(type) for accurate signature.

class ignite_framework.framework.framework.Modules[source]

Container for all torch.nn.Modules included for training.

__getattr__(name)

A smart getter for getting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_started
False
>>> state.state_run_started
False
>>> id(state.engines.state_status.state_run_started) == id(state.state_run_started)
Parameters:name (str) – state container name or state object name

Returns:

__setattr__(name, value)

A smart setter for setting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_completed = True
>>> state.engines.state_status.state_run_completed
True
>>> state.state_run_compelted = False
>>> state.engines.state_status.state_run_completed
False

Note

Performance

The __setattr__ of a state container is only used during state initialization, not during training. Therefore the setting-performance is of lower relevance.

__weakref__

list of weak references to the object (if defined)

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

integrate_new_state_component_class(component_class, integrated_attrs_args_dict={})
Integrate new state component class, e.g. PyTorch torch.nn.NewModule, or append additional/change existing
integrated attributes to/of existing state component class.
Parameters:
  • self
  • component_class – class of the new state component to be integrated
  • integrated_attrs_args_dict (dict) –
    dict(<attr_name>=(<bso_class>, <initial_value>, <component_attr_getter>,
    <component_attr_setter>))
  • attr__get__ – function that is forwarded to instance__get__ of BaseStateObject
  • attr__set__ – function that is forwarded to instance__set__ of BaseStateObject

Returns:

register_user_defined_ctrID_class(id_class)

Add/Register a new container-ID-class to a state cotnainer, e.g. a special tokenizer class to state.modules.

As soon as the new ID-class is registered at the state container, instances of this ID-class (or subclasses of the ID-class) can be set a s container attribute.

Parameters:
  • self – state container, e.g. state.modules, state.optimizer, etc.
  • id_class – a class from which a instance of this class the user wnats to attach to the state container

Returns:

class ignite_framework.framework.framework.Optimizers[source]

Container for all torch.nn.Optimizers.

__getattr__(name)

A smart getter for getting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_started
False
>>> state.state_run_started
False
>>> id(state.engines.state_status.state_run_started) == id(state.state_run_started)
Parameters:name (str) – state container name or state object name

Returns:

__setattr__(name, value)

A smart setter for setting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_completed = True
>>> state.engines.state_status.state_run_completed
True
>>> state.state_run_compelted = False
>>> state.engines.state_status.state_run_completed
False

Note

Performance

The __setattr__ of a state container is only used during state initialization, not during training. Therefore the setting-performance is of lower relevance.

__weakref__

list of weak references to the object (if defined)

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

integrate_new_state_component_class(component_class, integrated_attrs_args_dict={})
Integrate new state component class, e.g. PyTorch torch.nn.NewModule, or append additional/change existing
integrated attributes to/of existing state component class.
Parameters:
  • self
  • component_class – class of the new state component to be integrated
  • integrated_attrs_args_dict (dict) –
    dict(<attr_name>=(<bso_class>, <initial_value>, <component_attr_getter>,
    <component_attr_setter>))
  • attr__get__ – function that is forwarded to instance__get__ of BaseStateObject
  • attr__set__ – function that is forwarded to instance__set__ of BaseStateObject

Returns:

register_user_defined_ctrID_class(id_class)

Add/Register a new container-ID-class to a state cotnainer, e.g. a special tokenizer class to state.modules.

As soon as the new ID-class is registered at the state container, instances of this ID-class (or subclasses of the ID-class) can be set a s container attribute.

Parameters:
  • self – state container, e.g. state.modules, state.optimizer, etc.
  • id_class – a class from which a instance of this class the user wnats to attach to the state container

Returns:

class ignite_framework.framework.framework.OutputHandlers[source]

Container for all output handlers of e.g. metrics & loggers.

__getattr__(name)

A smart getter for getting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_started
False
>>> state.state_run_started
False
>>> id(state.engines.state_status.state_run_started) == id(state.state_run_started)
Parameters:name (str) – state container name or state object name

Returns:

__setattr__(name, value)

A smart setter for setting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_completed = True
>>> state.engines.state_status.state_run_completed
True
>>> state.state_run_compelted = False
>>> state.engines.state_status.state_run_completed
False

Note

Performance

The __setattr__ of a state container is only used during state initialization, not during training. Therefore the setting-performance is of lower relevance.

__weakref__

list of weak references to the object (if defined)

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

integrate_new_state_component_class(component_class, integrated_attrs_args_dict={})
Integrate new state component class, e.g. PyTorch torch.nn.NewModule, or append additional/change existing
integrated attributes to/of existing state component class.
Parameters:
  • self
  • component_class – class of the new state component to be integrated
  • integrated_attrs_args_dict (dict) –
    dict(<attr_name>=(<bso_class>, <initial_value>, <component_attr_getter>,
    <component_attr_setter>))
  • attr__get__ – function that is forwarded to instance__get__ of BaseStateObject
  • attr__set__ – function that is forwarded to instance__set__ of BaseStateObject

Returns:

register_user_defined_ctrID_class(id_class)

Add/Register a new container-ID-class to a state cotnainer, e.g. a special tokenizer class to state.modules.

As soon as the new ID-class is registered at the state container, instances of this ID-class (or subclasses of the ID-class) can be set a s container attribute.

Parameters:
  • self – state container, e.g. state.modules, state.optimizer, etc.
  • id_class – a class from which a instance of this class the user wnats to attach to the state container

Returns:

class ignite_framework.framework.framework.Parameters[source]

Training parameter container.

__getattr__(name)

A smart getter for getting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_started
False
>>> state.state_run_started
False
>>> id(state.engines.state_status.state_run_started) == id(state.state_run_started)
Parameters:name (str) – state container name or state object name

Returns:

__setattr__(name, value)

A smart setter for setting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_completed = True
>>> state.engines.state_status.state_run_completed
True
>>> state.state_run_compelted = False
>>> state.engines.state_status.state_run_completed
False

Note

Performance

The __setattr__ of a state container is only used during state initialization, not during training. Therefore the setting-performance is of lower relevance.

__weakref__

list of weak references to the object (if defined)

_check_ctr_attr_name_ctr_specifically(name, value)

Check if container attribute name name equals a container name as required.

Set container attribute name name where as name must be the container name which it is referencing the parameters from or helpers or argumnents

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

integrate_new_state_component_class(component_class, integrated_attrs_args_dict={})
Integrate new state component class, e.g. PyTorch torch.nn.NewModule, or append additional/change existing
integrated attributes to/of existing state component class.
Parameters:
  • self
  • component_class – class of the new state component to be integrated
  • integrated_attrs_args_dict (dict) –
    dict(<attr_name>=(<bso_class>, <initial_value>, <component_attr_getter>,
    <component_attr_setter>))
  • attr__get__ – function that is forwarded to instance__get__ of BaseStateObject
  • attr__set__ – function that is forwarded to instance__set__ of BaseStateObject

Returns:

register_user_defined_ctrID_class(id_class)

Add/Register a new container-ID-class to a state cotnainer, e.g. a special tokenizer class to state.modules.

As soon as the new ID-class is registered at the state container, instances of this ID-class (or subclasses of the ID-class) can be set a s container attribute.

Parameters:
  • self – state container, e.g. state.modules, state.optimizer, etc.
  • id_class – a class from which a instance of this class the user wnats to attach to the state container

Returns:

class ignite_framework.framework.framework.Pipelines[source]

Container for all output handlers of e.g. metrics & loggers.

__getattr__(name)

A smart getter for getting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_started
False
>>> state.state_run_started
False
>>> id(state.engines.state_status.state_run_started) == id(state.state_run_started)
Parameters:name (str) – state container name or state object name

Returns:

__setattr__(name, value)

A smart setter for setting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_completed = True
>>> state.engines.state_status.state_run_completed
True
>>> state.state_run_compelted = False
>>> state.engines.state_status.state_run_completed
False

Note

Performance

The __setattr__ of a state container is only used during state initialization, not during training. Therefore the setting-performance is of lower relevance.

__weakref__

list of weak references to the object (if defined)

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

integrate_new_state_component_class(component_class, integrated_attrs_args_dict={})
Integrate new state component class, e.g. PyTorch torch.nn.NewModule, or append additional/change existing
integrated attributes to/of existing state component class.
Parameters:
  • self
  • component_class – class of the new state component to be integrated
  • integrated_attrs_args_dict (dict) –
    dict(<attr_name>=(<bso_class>, <initial_value>, <component_attr_getter>,
    <component_attr_setter>))
  • attr__get__ – function that is forwarded to instance__get__ of BaseStateObject
  • attr__set__ – function that is forwarded to instance__set__ of BaseStateObject

Returns:

register_user_defined_ctrID_class(id_class)

Add/Register a new container-ID-class to a state cotnainer, e.g. a special tokenizer class to state.modules.

As soon as the new ID-class is registered at the state container, instances of this ID-class (or subclasses of the ID-class) can be set a s container attribute.

Parameters:
  • self – state container, e.g. state.modules, state.optimizer, etc.
  • id_class – a class from which a instance of this class the user wnats to attach to the state container

Returns:

class ignite_framework.framework.framework.State[source]

State is a singleton class containing the entire training state.

__setattr__(name, value)

Restrictive __settattr__ only allowing setting for existing state objects.

Existing or new state attributes and shortcuts of container attributes (transitions, components, references) are read only and cannot be (re-)set after initialization. :param self: :param name: :param value:

Returns:

__weakref__

list of weak references to the object (if defined)

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

run()[source]

User friendly method to “start the engines”. This method breaks with the structure of State as a static container for other static MetaStateContainer`s (e.g. `state.engines, state.modules) that has no user methods. Returns:

class ignite_framework.framework.framework.StateObjectsReference(owner_instances, fso_names, ref_caller_names: list = 'caller_name')[source]
class ignite_framework.framework.framework.StateParametersReference(owner_instances, fso_names, ref_caller_names: list = 'caller_name')[source]
class ignite_framework.framework.framework.StateStatus(name)[source]

Transition starting and endpoint of the state.engines state container.

The endpoints are defined by the state variable counters state.engines.state_status.state_run_started & state.engines.state_status.state_run_completed.

_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.TensoboardStatus(name)[source]
_bind_fso_to_owner_instance(fso_name)

Defines how the value and callback list of the state variable is added to the owner instance. :param self: frame state object container :param bso_name: name of attribute

Returns:

_filter_name_prefix_and_suffixes(name, get_or_set)

Prefilters all suffix comninations allowed for __getattr__ AND __setattr__ overload. If conditions ar not met, then getter/setter specific error is raised.

The everloads functinality of ‘_every’ & ‘_once’ are realized by implementing a new Every/OnceNumthCall transition with the standardized name <self.name>_every/once_<num_calls> that is stored in state.transitions. The overloaded __getattr__ & __setattr__ “just” handles the instantiation triggering and the referencing/forwarding values, calls and other overloads.

Parameters:
  • self
  • name
  • get_or_set

Returns:

_get_fso_reference(name)

Singleton like reference call which creates reference once, stored it in self.__dict__ and will be returned by self.__getattribute__()` in any following ref-get-calls.

Parameters:
  • self
  • name

Returns:

_get_or_set_once_or_every_conditional_call_and_return_name(once_or_every_transition_prefix, once_or_every_transition_variable_name, name, suffix, num_calls, value='')
Parameters:
  • once_or_every_transition_prefix
  • once_or_every_transition_variable_name
  • name
  • suffix
  • num_calls
  • value – setting value AND implicit get_or_set-flag, whereas ‘’ is equivalent to get_or_set=’get’
  • in a getter-like-call, and any other value invokes a setter-like-call wiht value as (resulting) –
  • setter-value

Returns:

_getattr_ctr_specifically(name)

Required for StateCompoennt`s where first the attribute is tried to get from teh component `self.component and only if that fails the attribute is gotten from self.

_handle_getattr_overload(name)

This handler deals with overloaded __getattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name

Returns:

_handle_setattr_overload(name, value)

This handler deals with overloaded __setattr__ for state variables. It identify and process correct overload attributes. In case of incorrect overload calls, an error is raised

Parameters:
  • self
  • name
  • value

Returns:

get(*name_or_parts)

Get method for parameterized attribute names, especially for state object containers, but not only.

Main reason is to simply avoid unhandy commands, e.g. getattr(state.transitions, ‘{}_{}’.format(name, suffix) commands and simply write state.transitions.get(name, suffix).

class ignite_framework.framework.framework.TensorboardStates[source]

Live training state visualization in Tensorboard. All features therefore are contained in here.

__getattr__(name)

A smart getter for getting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_started
False
>>> state.state_run_started
False
>>> id(state.engines.state_status.state_run_started) == id(state.state_run_started)
Parameters:name (str) – state container name or state object name

Returns:

__setattr__(name, value)

A smart setter for setting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_completed = True
>>> state.engines.state_status.state_run_completed
True
>>> state.state_run_compelted = False
>>> state.engines.state_status.state_run_completed
False

Note

Performance

The __setattr__ of a state container is only used during state initialization, not during training. Therefore the setting-performance is of lower relevance.

__weakref__

list of weak references to the object (if defined)

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

integrate_new_state_component_class(component_class, integrated_attrs_args_dict={})
Integrate new state component class, e.g. PyTorch torch.nn.NewModule, or append additional/change existing
integrated attributes to/of existing state component class.
Parameters:
  • self
  • component_class – class of the new state component to be integrated
  • integrated_attrs_args_dict (dict) –
    dict(<attr_name>=(<bso_class>, <initial_value>, <component_attr_getter>,
    <component_attr_setter>))
  • attr__get__ – function that is forwarded to instance__get__ of BaseStateObject
  • attr__set__ – function that is forwarded to instance__set__ of BaseStateObject

Returns:

register_user_defined_ctrID_class(id_class)

Add/Register a new container-ID-class to a state cotnainer, e.g. a special tokenizer class to state.modules.

As soon as the new ID-class is registered at the state container, instances of this ID-class (or subclasses of the ID-class) can be set a s container attribute.

Parameters:
  • self – state container, e.g. state.modules, state.optimizer, etc.
  • id_class – a class from which a instance of this class the user wnats to attach to the state container

Returns:

class ignite_framework.framework.framework.TransitionStates[source]

State container containing all transitions which are no engines, metrics, maintainer, etc.. For example, the `Once/EveryNumthValue class that is created when calling e.g. state.trainer.n_epoch_iteration_started_every_10.

__getattr__(name)

A smart getter for getting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_started
False
>>> state.state_run_started
False
>>> id(state.engines.state_status.state_run_started) == id(state.state_run_started)
Parameters:name (str) – state container name or state object name

Returns:

__setattr__(name, value)

A smart setter for setting with shortcuts.

from ignite_framework.states import state

>>> state.engines.state_status.state_run_completed = True
>>> state.engines.state_status.state_run_completed
True
>>> state.state_run_compelted = False
>>> state.engines.state_status.state_run_completed
False

Note

Performance

The __setattr__ of a state container is only used during state initialization, not during training. Therefore the setting-performance is of lower relevance.

__weakref__

list of weak references to the object (if defined)

get(*name_or_parts)

Get method for parameterized attribute names, especially for state objects, but not only.

Main reason is to simply avoid unhandy commands e.g. getattr(state.trainer, ‘{}_{}’.format(name, suffix) commands and simply write state.trainer.get(name, suffix).

integrate_new_state_component_class(component_class, integrated_attrs_args_dict={})
Integrate new state component class, e.g. PyTorch torch.nn.NewModule, or append additional/change existing
integrated attributes to/of existing state component class.
Parameters:
  • self
  • component_class – class of the new state component to be integrated
  • integrated_attrs_args_dict (dict) –
    dict(<attr_name>=(<bso_class>, <initial_value>, <component_attr_getter>,
    <component_attr_setter>))
  • attr__get__ – function that is forwarded to instance__get__ of BaseStateObject
  • attr__set__ – function that is forwarded to instance__set__ of BaseStateObject

Returns:

register_user_defined_ctrID_class(id_class)

Add/Register a new container-ID-class to a state cotnainer, e.g. a special tokenizer class to state.modules.

As soon as the new ID-class is registered at the state container, instances of this ID-class (or subclasses of the ID-class) can be set a s container attribute.

Parameters:
  • self – state container, e.g. state.modules, state.optimizer, etc.
  • id_class – a class from which a instance of this class the user wnats to attach to the state container

Returns:

ignite_framework.framework.framework.add_output_handler_methods_and_attrs_to_namespace(name, bases, namespace, output_name)[source]

All methods target to set the output state variable arguments instance_attr__get/set__ in the instance of the class of the output handler metaclass (in self.__init__) while output has already been initialized in the metaclass. So the arguments normally would have to be available when the class is generated by the metaclass (typ.__new__()), but are first available during instance initialization (self.__init__()). :param name: :param bases: :param namespace:

Returns: