Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 220
Jonathan Roy Avatar asked Oct 15 '22 09:10

Jonathan Roy


1 Answers

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.

like image 191
Vivek Mehta Avatar answered Oct 21 '22 07:10

Vivek Mehta