pytorch_pfn_extras.training.extensions.MaxValue#
- class pytorch_pfn_extras.training.extensions.MaxValue(key, trigger=(1, 'epoch'))#
Bases:
BestValueExtension traces the maximum value of a specific key in the observation.
- Parameters:
key (str) – Key of value.
trigger (TriggerLike) – Trigger that decides the comparison interval between current maximum value and new value. This must be a tuple in the form of
<int>, 'epoch'or<int>, 'iteration'which is passed toBestValueTrigger.
Methods
__init__(key[, trigger])finalize(manager)Finalizes the extension.
initialize(manager)Initializes up the manager state.
load_state_dict(to_load)on_error(manager, exc, tb)Handles the error raised during training before finalization.
state_dict()Serializes the extension state.
Attributes
best_epochReturns the epoch count that the current best value is observed.
best_iterationReturns the iteration count that the current best value is observed.
best_valueReturns the current best value.
is_asyncnameneeds_model_stateprioritytrigger- __init__(key, trigger=(1, 'epoch'))#
- Parameters:
key (str) –
trigger (TriggerLike) –
- default_name = 'max_value'#