Created
January 4, 2021 06:47
-
-
Save Rishit-dagli/c901880f0df703fe3c0d516ff2a61648 to your computer and use it in GitHub Desktop.
exponential decay with 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
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