Created
June 6, 2020 05:40
-
-
Save Mistobaan/786496ca8b1b75c2580e1915d37ef7eb to your computer and use it in GitHub Desktop.
How to Compute Virtual Epochs in Tensorflow
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
NUM_TRAINING_EXAMPLES = 1000 * 1000 | |
STOP_POINT = 14.3 | |
TOTAL_TRAINING_EXAMPLES = int(STOP_POINT * NUM_TRAINING_EXAMPLES) | |
BATCH_SIZE = 100 | |
NUM_CHECKPOINTS = 15 | |
steps_per_epoch = (TOTAL_TRAINING_EXAMPLES // | |
(BATCH_SIZE*NUM_CHECKPOINTS)) | |
cp_callback = tf.keras.callbacks.ModelCheckpoint(...) | |
history = model.fit(trainds, | |
validation_data=evalds, | |
epochs=NUM_CHECKPOINTS, | |
steps_per_epoch=steps_per_epoch, | |
batch_size=BATCH_SIZE, | |
callbacks=[cp_callback]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment