Skip to content

Instantly share code, notes, and snippets.

@Rishit-dagli
Created January 4, 2021 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rishit-dagli/c901880f0df703fe3c0d516ff2a61648 to your computer and use it in GitHub Desktop.
Save Rishit-dagli/c901880f0df703fe3c0d516ff2a61648 to your computer and use it in GitHub Desktop.
exponential decay with TensorFlow
initial_learning_rate = 0.1
lr_schedule = tf.keras.optimizers.schedules.ExponentialDecay(
initial_learning_rate,
decay_steps = 100000,
decay_rate = 0.96,
staircase = True)
model.compile(optimizer=tf.keras.optimizers.SGD(learning_rate = lr_schedule),
loss = 'sparse_categorical_crossentropy',
metrics = ['accuracy'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment