pytorch_pfn_extras.training.extensions.MaxValue#

class pytorch_pfn_extras.training.extensions.MaxValue(key, trigger=(1, 'epoch'))#

Bases: BestValue

Extension 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 to BestValueTrigger.

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_epoch

Returns the epoch count that the current best value is observed.

best_iteration

Returns the iteration count that the current best value is observed.

best_value

Returns the current best value.

default_name

is_async

name

needs_model_state

priority

trigger

__init__(key, trigger=(1, 'epoch'))#
Parameters:
  • key (str) –

  • trigger (TriggerLike) –

default_name = 'max_value'#