pytorch_pfn_extras.training.triggers.minmax_value_trigger.MaxValueTrigger#
- class pytorch_pfn_extras.training.triggers.minmax_value_trigger.MaxValueTrigger(key, trigger=(1, 'epoch'))#
Bases:
BestValueTrigger
Trigger invoked when specific value becomes maximum.
For example you can use this trigger to take snapshot on the epoch the validation accuracy is maximum.
- Parameters:
key (str) – Key of value. The trigger fires when the value associated with this key becomes maximum.
trigger (TriggerLike) – Trigger that decides the comparison interval between current best value and new value. This must be a tuple in the form of
<int>, 'epoch'
or<int>, 'iteration'
which is passed toIntervalTrigger
.
Methods
__init__
(key[, trigger])load_state_dict
(to_load)may_fire
(iteration, epoch_length)Flags if the trigger may fire at the current iteration
state_dict
()- __init__(key, trigger=(1, 'epoch'))#
- Parameters:
key (str) –
trigger (TriggerLike) –