xnn.common.train.callbacks.monitored_value#

xnn.common.train.callbacks.monitored_value(metrics, monitor)[source]#

The value of monitor in metrics, or None when its split was not evaluated.

Parameters:
  • metrics (dict of str to float) – Epoch metrics (train/..., val/...).

  • monitor (str) – The monitored key, e.g. "val/forces_mae".

Returns:

None when no value of the monitor’s split is present (a validation set skipped this epoch).

Return type:

float or None

Raises:

KeyError – When the split is present but the key is not.