pytorch_pfn_extras.training.extensions.observe_value

pytorch_pfn_extras.training.extensions.observe_value(observation_key, target_func)

Returns an extension to continuously record a value.

Parameters
  • observation_key (str) – Key of observation to record.

  • target_func (function) – Function that returns the value to record. It must take one argument: :class:~pytorch_pfn_extras.training.ExtensionsManager object.

Returns

The extension function.

Return type

Callable[[pytorch_pfn_extras.training._manager_protocol.ExtensionsManagerProtocol], None]

This extension is triggered each epoch by default. To change this, use the trigger argument with the ExtensionsManager.extend() method.