TFEpochLogger

Logger class for logging accuracy and loss from epochs when training a tf.keras.Model. Inherits from tf.keras.callbacks.Callback and should be passed in as a callback during model training.

class spiegelib.estimator.TFEpochLogger

Bases: tensorflow.python.keras.callbacks.Callback

log_data

Dictionary of data logged at the end of each epoch during training. Keyed on the epoch number.

Type

dict

on_epoch_end(epoch, logs=None)

Logging on end of an epoch. This is called automatically during training. Stores infomation passed in the logs parameter into log_data attribute.

Parameters
  • epoch (int) – current epoch that just finished

  • logs – Any data to be logged

get_plotting_data()

Helper function to organize log_data for easier plotting

plot()

Plot logged training and validation data using matplotlib