Do Keras epoch-counting callbacks work across several fitting sessions?
Some Keras callbacks, like
ReduceLROnPlateau, rely on counting the number of epochs that some condition is met until some action is taken.
For certain purposes I need to train a Keras model in several fitting sessions, so something like
for epoch in range(num_epochs): model.fit(data, epochs=1)
I was wondering if Keras callbacks work even if I use them across several fitting sessions.
model.fit(...) is called
callbacks.History is reset. So no, it will not work like that. While you could log yourself as @kacpo1 mentioned and save each, you may benefit from the
train_on_batch(...) method. This performs a single update and you can set
reset_metrics=False in the method call to retain your metrics.
Answered By – Aidan Costello