pytorch_pfn_extras.reporting.DictSummary#

class pytorch_pfn_extras.reporting.DictSummary#

Bases: object

Online summarization of a sequence of dictionaries.

DictSummary computes the statistics of a given set of scalars online. It only computes the statistics for scalar values and variables of scalar values in the dictionaries.

Methods

__init__()

add(d)

Adds a dictionary of scalars.

compute_mean()

Creates a dictionary of mean values.

load_state_dict(to_load)

make_statistics()

Creates a dictionary of statistics.

state_dict()

__init__()#
Return type:

None

add(d)#

Adds a dictionary of scalars.

Parameters:

d (dict) – Dictionary of scalars to accumulate. Only elements of scalars, zero-dimensional arrays, and variables of zero-dimensional arrays are accumulated. When the value is a tuple, the second element is interpreted as a weight.

Return type:

None

compute_mean()#

Creates a dictionary of mean values.

It returns a single dictionary that holds a mean value for each entry added to the summary.

Returns:

Dictionary of mean values.

Return type:

dict

load_state_dict(to_load)#
Parameters:

to_load (Dict[str, Any]) –

Return type:

None

make_statistics()#

Creates a dictionary of statistics.

It returns a single dictionary that holds mean and standard deviation values for every entry added to the summary. For an entry of name 'key', these values are added to the dictionary by names 'key' and 'key.std', respectively.

Returns:

Dictionary of statistics of all entries.

Return type:

dict

state_dict()#
Return type:

Dict[str, Any]