Created
June 3, 2017 03:44
-
-
Save dead/29f5e4433f888caf3ef51e0b56455c9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
def plot_model_history(h, mode="loss"): | |
legend = [mode] | |
x = range(len(h[mode])) | |
plt.plot(x, h[mode], marker='.') | |
if "val_" + mode in h: | |
legend.append("val_" + mode) | |
plt.plot(x, h["val_" + mode], marker='.') | |
plt.xlabel('Epochs') | |
plt.title(mode + ' over epochs') | |
plt.legend(legend, loc = 'center right', bbox_to_anchor=(1.3, 0.5)) | |
plt.show() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No jupyter antes do import usar:
%matplotlib inline