utils.tracker.multi_value#

Classes

MultiValueTracker(base_tracker)

A Tracker for storing multiple values at once in the form of a dict mapping from keys to individual Trackers.

class utils.tracker.multi_value.MultiValueTracker(base_tracker)[source]#

Bases: Tracker

A Tracker for storing multiple values at once in the form of a dict mapping from keys to individual Trackers.

tracked_value#

The dictionary containing the individual trackers for each value.

Type:

dict

__call__()[source]#

Returns the current tracked values.

get()[source]#

Returns the current tracked values.

Return type:

dict

get_normalized()[source]#

Normalizes the tracked values by dividing them through the sum of the values.

update(values)[source]#

Adds one value for tracked object to the tracker.

Note

Whenever the input dictionary contains a new key not stored in the Tracker, it will be added to its storage.

Parameters:

values (dict) – A dictionary mapping from keys to numeric values to be added to the tracker.

Return type:

Tracker