Created
May 7, 2018 21:20
-
-
Save alessiamarcolini/ce99df5b2d5d71d9ab480114756fc718 to your computer and use it in GitHub Desktop.
Drop Based Learning Rate Schedule - Keras
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
def step_decay(epoch): | |
initial_lrate = 0.1 | |
drop = 0.5 | |
epochs_drop = 10.0 | |
lrate = initial_lrate * math.pow(drop, math.floor((1+epoch)/epochs_drop)) | |
return lrate | |
# ... | |
lrate = LearningRateScheduler(step_decay) | |
callbacks_list = [lrate] | |
# Fit the model | |
model.fit(X, Y, validation_split=0.33, epochs=50, batch_size=32, callbacks=callbacks_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment