Skip to content

Instantly share code, notes, and snippets.

@vikramsoni2
Created November 22, 2021 00:58
Show Gist options
  • Save vikramsoni2/1b4856bd5aebf5825b28a7fa40e28ffa to your computer and use it in GitHub Desktop.
Save vikramsoni2/1b4856bd5aebf5825b28a7fa40e28ffa to your computer and use it in GitHub Desktop.
Tensorflow plot history using matplotlib
import matplotlib.pyplot as plt
def plot_graphs(history, string):
plt.plot(history.history[string])
plt.plot(history.history['val_'+string])
plt.xlabel("Epochs")
plt.ylabel(string)
plt.legend([string, 'val_'+string])
plt.show()
plot_graphs(history, "accuracy")
plot_graphs(history, "loss")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment