Skip to content

Tracker

Tracks loss, accuracy and model weights during model.fit()

__getitem__(self, key) special

  1. key= train | val then return respective TrackingValues object
  2. key=metrics then return a dictionary of metrics
  3. key=loss then return a dictionary of losses

Parameters:

Name Type Description Default
key str

train, val, metrics or loss

required

Returns:

Type Description

TrackingValues or a Dictionary

reset(self)

Resets epochs, logs and train & val TrackingValues.

track_loss(self, loss, mode)

Tracks loss by adding to Tracker.logs and maintaining average loss in a single Epoch with TrackingValues. Update loss with TrackingValues.update_loss(loss) which is called with TrainEvalCallback at *_step_end.

Parameters:

Name Type Description Default
loss float

Step Loss

required
mode str

can be train | val

required

track_metrics(self, metric, mode)

Tracks metrics by adding to Tracker.logs and maintaining average metric in a single Epoch with TrackingValues. Update metrics with TrackingValues.update_metrics(metrics) which is called with TrainEvalCallback at *_step_end.

Parameters:

Name Type Description Default
metric Dict[str, float]

Step metric

required
mode str

can be train | val

required

Last update: October 3, 2021