Skip to content

Instantly share code, notes, and snippets.

@alessiamarcolini
Created May 7, 2018 21:20
Show Gist options
  • Save alessiamarcolini/ce99df5b2d5d71d9ab480114756fc718 to your computer and use it in GitHub Desktop.
Save alessiamarcolini/ce99df5b2d5d71d9ab480114756fc718 to your computer and use it in GitHub Desktop.
Drop Based Learning Rate Schedule - Keras
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