Skip to content

Instantly share code, notes, and snippets.

@VedPDubey
Last active July 2, 2021 16:54
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/690e4110909cc41569b38e4c16136341 to your computer and use it in GitHub Desktop.
Save VedPDubey/690e4110909cc41569b38e4c16136341 to your computer and use it in GitHub Desktop.
def show_final_history(history):
fig, ax = plt.subplots(1, 2, figsize=(15,5))
ax[0].set_title('loss')
ax[0].plot(history.epoch, history.history["loss"], label="Train loss")
ax[0].plot(history.epoch, history.history["val_loss"], label="Validation loss")
ax[1].set_title('acc')
ax[1].plot(history.epoch, history.history["accuracy"], label="Train acc")
ax[1].plot(history.epoch, history.history["val_accuracy"], label="Validation acc")
ax[0].legend()
ax[1].legend()
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