Skip to content

Instantly share code, notes, and snippets.

@VedPDubey
Last active July 9, 2021 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VedPDubey/ea27b667da4c84abf1f93e96292f06db to your computer and use it in GitHub Desktop.
Save VedPDubey/ea27b667da4c84abf1f93e96292f06db to your computer and use it in GitHub Desktop.
def show_final_history(history):
plt.style.use("ggplot")
fig, ax = plt.subplots(1,2,figsize=(15,5))
ax[0].set_title('Loss')
ax[1].set_title('Accuracy')
ax[0].plot(history.history['loss'],label='Train Loss')
ax[0].plot(history.history['val_loss'],label='Validation Loss')
ax[1].plot(history.history['accuracy'],label='Train Accuracy')
ax[1].plot(history.history['val_accuracy'],label='Validation Accuracy')
ax[0].legend(loc='upper right')
ax[1].legend(loc='lower right')
plt.show();
pass
show_final_history(history)
model.save("model.h5")
print("Weights Saved")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment