Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
plots.py 710 B
import matplotlib.pyplot as plt
def plot_accuracy(name, history, ylim=[0,1.01]):
plt.plot(history.history['accuracy'])
plt.plot(history.history['val_accuracy'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.ylim(ylim[0], ylim[1])
plt.legend(['training', 'validation'], loc='upper left')
plt.savefig(name)
plt.show()
def plot_loss(name, history, ylim=[-0.5,2]):
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.ylim(ylim[0],ylim[1])
plt.legend(['training', 'validation'], loc='upper left')
plt.savefig(name)
plt.show()