pytorch_pfn_extras.reporting.Summary#
- class pytorch_pfn_extras.reporting.Summary#
Bases:
object
Online summarization of a sequence of scalars.
Summary computes the statistics of given scalars online.
Methods
__init__
()add
(value[, weight])Adds a scalar value.
Computes the mean.
load_state_dict
(to_load)Computes and returns the mean and standard deviation values.
- __init__()#
- Return type:
None
- add(value, weight=1)#
Adds a scalar value.
- Parameters:
value (Union[Tensor, ndarray, floating, float, Callable[[], float]]) – Scalar value to accumulate. It is either a NumPy scalar or a zero-dimensional array (on CPU or GPU).
weight (Union[Tensor, ndarray, floating, float]) – An optional weight for the value. It is a NumPy scalar or a zero-dimensional array (on CPU or GPU). Default is 1 (integer).
- Return type:
None
- compute_mean()#
Computes the mean.
- Return type:
Union[Tensor, ndarray, floating, float]
- load_state_dict(to_load)#
- Parameters:
to_load (Dict[str, Any]) –
- Return type:
None
- make_statistics()#
Computes and returns the mean and standard deviation values.
- Returns:
Mean and standard deviation values.
- Return type:
tuple
- state_dict()#
- Return type:
Dict[str, Any]