Last active
May 27, 2019 19:39
-
-
Save frogermcs/c40cc2a2fcfd490e8be0575afc4c3c80 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
steps_per_epoch = np.ceil(train_generator.samples/train_generator.batch_size) | |
val_steps_per_epoch = np.ceil(valid_generator.samples/valid_generator.batch_size) | |
hist = model.fit( | |
train_generator, | |
epochs=10, | |
verbose=1, | |
steps_per_epoch=steps_per_epoch, | |
validation_data=valid_generator, | |
validation_steps=val_steps_per_epoch).history | |
# Measure accuracy and loss after training | |
final_loss, final_accuracy = model.evaluate(valid_generator, steps = val_steps_per_epoch) | |
print("Final loss: {:.2f}".format(final_loss)) | |
print("Final accuracy: {:.2f}%".format(final_accuracy * 100)) | |
# >> Final loss: 0.44 | |
# >> Final accuracy: 87.41% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment