Created
July 13, 2021 17:26
-
-
Save jeetaf/17f3de22dca16853c1342f9e3988f6a6 to your computer and use it in GitHub Desktop.
This file contains 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
def plot_learningCurve(history, epoch): | |
# Plot training & validation accuracy values | |
epoch_range = range(1, epoch+1) | |
plt.plot(epoch_range, history.history['acc']) | |
plt.plot(epoch_range, history.history['val_acc']) | |
plt.title('Model accuracy') | |
plt.ylabel('Accuracy') | |
plt.xlabel('Epoch') | |
plt.legend(['Train', 'Val'], loc='upper left') | |
plt.show() | |
# Plot training & validation loss values | |
plt.plot(epoch_range, history.history['loss']) | |
plt.plot(epoch_range, history.history['val_loss']) | |
plt.title('Model loss') | |
plt.ylabel('Loss') | |
plt.xlabel('Epoch') | |
plt.legend(['Train', 'Val'], loc='upper left') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment