Created
January 4, 2019 08:28
-
-
Save jonathanoheix/2e7a7d05096c15c0a09961b7ca73cfc6 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
# number of epochs to train the NN | |
epochs = 50 | |
from keras.callbacks import ModelCheckpoint | |
checkpoint = ModelCheckpoint("model_weights.h5", monitor='val_acc', verbose=1, save_best_only=True, mode='max') | |
callbacks_list = [checkpoint] | |
history = model.fit_generator(generator=train_generator, | |
steps_per_epoch=train_generator.n//train_generator.batch_size, | |
epochs=epochs, | |
validation_data = validation_generator, | |
validation_steps = validation_generator.n//validation_generator.batch_size, | |
callbacks=callbacks_list | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment