Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save overtunned/6980b2acdfe78b07c7ad6a5ca0ca638f to your computer and use it in GitHub Desktop.

Select an option

Save overtunned/6980b2acdfe78b07c7ad6a5ca0ca638f to your computer and use it in GitHub Desktop.
plot keras
def plot_learning_curve(history):
plt.figure(figsize=(16,8))
plt.subplot(1,2,1)
plt.plot(history.history['accuracy'])
plt.plot(history.history['val_accuracy'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'Val'], loc='upper left')
plt.savefig('./accuracy_curve.png')
plt.subplot(1,2,2)
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.savefig('./loss_curve.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment