Visualize training history from a model

I want to generate accuracy/loss vs epoch graph from a trained model. Is it possible to do so? an example image is attached.

1 Like

You could plot the accuracy e.g. using tensorboard as described here.

@ptrblck is it possible to generate graph with already trained pytorch model?

If you have saved the accuracy values for each epoch, this should be possible.
Otherwise, you would need to rerun the training and plot the metrics for each epoch.

Here is the code in python to do so:

from keras.callbacks import History
history = model.fit(X_test, y_train, epochs = 40, batch_size = 5, verbose = 1)
accuracy = history.history[“accuracy”]
epochs = range(1, len(accuracy) + 1)
import matplotlib.pyplot as plt
plt.plot(epochs, accuracy)
plt.show()