Shortcuts

Transitions

Base classes

class ignite_framework.transitions.base_transitions.BaseConditionalTransition(name)[source]
condition() → bool[source]

Any condition returning a bool :param engine:

Returns:True or False
false_tranform()[source]

Transformation either setting self.output or any other value in state if self.condition() == False.

Parameters:engine
Returns:self.output is the output state variable therefore no return is required.
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).

get_bso_names()
n_false_transforms

Iteration counter is a state variable, only allowing ‘’int’’ with increasing values by step size ‘+`1`.

n_true_transforms

Iteration counter is a state variable, only allowing ‘’int’’ with increasing values by step size ‘+`1`.

name = 'BaseConditionalTransition'
run()[source]
set(*name_or_parts_and_value)
true_transform()[source]

Transformation either setting self.output or any other value in state if self.condition() == True.

Parameters:engine
Returns:self.output is the output state variable therefore no return is required.
class ignite_framework.transitions.base_transitions.BaseMultiInputsTransition(name, input_refs, caller_refs='')[source]
n_calls

Iteration counter is a state variable, only allowing ‘’int’’ with increasing values by step size ‘+`1`.

name = 'BaseMultiInputsTransition'
output

StateVariable is the basic state variable without any additional type checking or setting conditions.

Features:

  • gets/sets/calls a _value and gets/sets/calls a list of callbacks which are callables triggered when _value is set

  • overloaded suffixes: [‘_callbacks’, _ref’, ‘_every’, ‘_once’]

    • _ref: returns StateObjectsReference-instance of itself
    • _callbacks: returns list of callbacks (functions called when value is set)
  • set-value type dependent __set__() overload:

    • CALLABLE_TYPES & tuple`([<CALLABLE_TYPES>, <dict>]): appended to its `_callbacks-list
    • any other type: sets its _value
  • state shortcut auto-generation

class ignite_framework.transitions.base_transitions.BaseTransformer(name)[source]
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).

get_bso_names()
n_transform

Iteration counter is a state variable, only allowing ‘’int’’ with increasing values by step size ‘+`1`.

name = 'BaseTransformer'
run()[source]
set(*name_or_parts_and_value)
transform()[source]

Transformation either setting self.output or any other value in state.

Parameters:engine

Returns:

class ignite_framework.transitions.base_transitions.BaseTransition(name)[source]

Base class for all transitions.

name = 'BaseTransition'

Transitions

class ignite_framework.transitions.conditional_counters.EveryNumthValue(name, conditional_value_ref, threshold_or_num_calls, caller_refs='', min_or_max='max')[source]
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`.

false_transform()[source]
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).

get_bso_names()
n_conditional_counts

StateVariable is the basic state variable without any additional type checking or setting conditions.

Features:

  • gets/sets/calls a _value and gets/sets/calls a list of callbacks which are callables triggered when _value is set

  • overloaded suffixes: [‘_callbacks’, _ref’, ‘_every’, ‘_once’]

    • _ref: returns StateObjectsReference-instance of itself
    • _callbacks: returns list of callbacks (functions called when value is set)
  • set-value type dependent __set__() overload:

    • CALLABLE_TYPES & tuple`([<CALLABLE_TYPES>, <dict>]): appended to its `_callbacks-list
    • any other type: sets its _value
  • state shortcut auto-generation

name = 'EveryNumthValue'
set(*name_or_parts_and_value)
true_transform()[source]
class ignite_framework.transitions.conditional_counters.OnceNumthValue(name, conditional_value_ref, threshold_or_num_calls, caller_refs='', min_or_max='max')[source]
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`.

false_transform()[source]
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).

get_bso_names()
n_conditional_counts

StateVariable is the basic state variable without any additional type checking or setting conditions.

Features:

  • gets/sets/calls a _value and gets/sets/calls a list of callbacks which are callables triggered when _value is set

  • overloaded suffixes: [‘_callbacks’, _ref’, ‘_every’, ‘_once’]

    • _ref: returns StateObjectsReference-instance of itself
    • _callbacks: returns list of callbacks (functions called when value is set)
  • set-value type dependent __set__() overload:

    • CALLABLE_TYPES & tuple`([<CALLABLE_TYPES>, <dict>]): appended to its `_callbacks-list
    • any other type: sets its _value
  • state shortcut auto-generation

name = 'OnceNumthValue'
set(*name_or_parts_and_value)
true_transform()[source]
class ignite_framework.transitions.early_stopping.EarlyStopping(name, patience, loss_function, output_var_ref, started_var_ref=<ignite_framework.framework.framework.StateObjectsReference object>, completed_var_ref=<ignite_framework.framework.framework.StateObjectsReference object>)[source]

Firing a early stopping event each time the early stopping conditions are reached, but without stopping the training. Therefore the optimum checkpoint time can be verified from a post=training viewpoint. As saving checkpoints of e.g. model, tokenizer, vocabs, configs etc.

condition()[source]

Any condition returning a bool :param engine:

Returns:True or False
current_loss

StateVariable is the basic state variable without any additional type checking or setting conditions.

Features:

  • gets/sets/calls a _value and gets/sets/calls a list of callbacks which are callables triggered when _value is set

  • overloaded suffixes: [‘_callbacks’, _ref’, ‘_every’, ‘_once’]

    • _ref: returns StateObjectsReference-instance of itself
    • _callbacks: returns list of callbacks (functions called when value is set)
  • set-value type dependent __set__() overload:

    • CALLABLE_TYPES & tuple`([<CALLABLE_TYPES>, <dict>]): appended to its `_callbacks-list
    • any other type: sets its _value
  • state shortcut auto-generation

minimum_loss

StateVariable is the basic state variable without any additional type checking or setting conditions.

Features:

  • gets/sets/calls a _value and gets/sets/calls a list of callbacks which are callables triggered when _value is set

  • overloaded suffixes: [‘_callbacks’, _ref’, ‘_every’, ‘_once’]

    • _ref: returns StateObjectsReference-instance of itself
    • _callbacks: returns list of callbacks (functions called when value is set)
  • set-value type dependent __set__() overload:

    • CALLABLE_TYPES & tuple`([<CALLABLE_TYPES>, <dict>]): appended to its `_callbacks-list
    • any other type: sets its _value
  • state shortcut auto-generation

n_early_stops

Iteration counter is a state variable, only allowing ‘’int’’ with increasing values by step size ‘+`1`.

n_false_transforms

Iteration counter is a state variable, only allowing ‘’int’’ with increasing values by step size ‘+`1`.

n_true_transforms

Iteration counter is a state variable, only allowing ‘’int’’ with increasing values by step size ‘+`1`.

name = 'EarlyStopping'