Created
June 20, 2020 23:07
-
-
Save vishwanath79/8e6c0282e1ff90485d4bba3628de410f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
save_best_callback = tf.keras.callbacks.ModelCheckpoint( | |
'content/model-{epoch:02d}-{val_acc:.2f}.f5', | |
monitor='val_accuracy', | |
verbose=1, | |
save_best_only=True, | |
save_weights_only=False, | |
save_freq=100, | |
) | |
model.fit( | |
X_train, | |
y_train, | |
batch_size=64, | |
class_weight=class_weight, | |
validation_split=0.1, | |
epochs=50, | |
callbacks=[save_best_callback], | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment