Jonathan Roy
Jonathan Roy

Reputation: 441

Save history with model on callback ModelCheckpoint

I use keras callback ModelCheckpoint to save my best train model. It is possible to save the corresponding history in same way for plotting?

Upvotes: 5

Views: 928

Answers (1)

Vivek Mehta
Vivek Mehta

Reputation: 2642

You can add CSVLogger callback from keras along with your ModelCheckpoint in the list of callbacks.

history = model.fit(X,y, epochs=100, callbacks=[keras.callbacks.CSVLogger('history.csv')])

This will dump all metrics information at each epoch to CSV file which you can use for plotting. Also, model.fit returns keras History object which can further be used for visualization.

Upvotes: 3

Related Questions