Last active
July 15, 2020 12:07
-
-
Save nitin-bommi/8bd53fd7eaf96cacdc9657fdd29aa4db 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
# training the model | |
history = model.fit(train_generator, | |
steps_per_epoch = 1000, # len(train) / BS | |
epochs = 100, | |
validation_data = validation_generator, | |
validation_steps = 500, # len(test) / BS | |
verbose = 2 | |
) | |
# visualising the loss and accuracy | |
import matplotlib.pyplot as plt | |
acc = history.history['accuracy'] | |
val_acc = history.history['val_accuracy'] | |
loss = history.history['loss'] | |
val_loss = history.history['val_loss'] | |
epochs = range(len(acc)) | |
plt.plot(epochs, acc, 'bo', label='Training accuracy') | |
plt.plot(epochs, val_acc, 'b', label='Validation accuracy') | |
plt.title('Training and validation accuracy') | |
plt.figure() | |
plt.plot(epochs, loss, 'bo', label='Training Loss') | |
plt.plot(epochs, val_loss, 'b', label='Validation Loss') | |
plt.title('Training and validation loss') | |
plt.legend() | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment