zea.models.utils

Utilities for models

Classes

LossTrackerWrapper(prefix)

A wrapper for Keras Mean metrics to track multiple loss values.

class zea.models.utils.LossTrackerWrapper(prefix)[source]

Bases: object

A wrapper for Keras Mean metrics to track multiple loss values.

reset_state()[source]

Reset all the internal trackers.

result()[source]

Return a dictionary with the current average results.

update_state(loss_value)[source]

Update the tracker(s) with a loss value.

If loss_value is a dict, then for each key a separate tracker is created (if not already created) and updated. The tracker’s name will be <prefix>_<key>. If loss_value is not a dict, then a default tracker with name <prefix> is updated.

Parameters:

loss_value – A tensor or a dictionary mapping field names to tensors.