# Tutorial on Cyclical LR

**URL:** <https://discuss.ai.google.dev/t/tutorial-on-cyclical-lr/31943>\
**Category:** Show and Tell\
**Tags:** education, learning, addons, keras, models\
**Created:** [June 17, 2021, 4:02am UTC](https://discuss.ai.google.dev/t/tutorial-on-cyclical-lr/31943 "2021-06-17T04:02:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sayak\_Paul](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/sayak_paul/32/13002_2.png) [@Sayak\_Paul](https://discuss.ai.google.dev/u/Sayak_Paul)\
**Post date:** [June 17, 2021, 4:02am UTC](https://discuss.ai.google.dev/t/tutorial-on-cyclical-lr/31943/1 "2021-06-17T04:02:38Z")

</div>

It’s been a while TensorFlow Addons released an easy-to-use wrapper for Cyclical Learning Rates. Today, we are pleased to release its accompanying tutorial guide:

> **[TensorFlow Addons Optimizers: CyclicalLearningRate](https://www.tensorflow.org/addons/tutorials/optimizers_cyclicallearningrate)**

Usage is straightforward:

```python
steps_per_epoch = len(x_train) // BATCH_SIZE
clr = tfa.optimizers.CyclicalLearningRate(initial_learning_rate=INIT_LR,
    maximal_learning_rate=MAX_LR,
    scale_fn=lambda x: 1/(2.**(x-1)),
    step_size=2 * steps_per_epoch
)
optimizer = tf.keras.optimizers.SGD(clr)

```
