guides/writing_your_own_callbacks.py/LossAndErrorPrintingCallback/on_epoch_end
class LossAndErrorPrintingCallback:    def on_epoch_end(self, epoch, logs=None):
        print(
            "The average loss for epoch {} is {:7.2f} "
            "and mean absolute error is {:7.2f}.".format(
                epoch, logs["loss"], logs["mean_absolute_error"]
            )
        )