class_docstr: A LearningRateSchedule that uses cyclical schedule.
class_docstr_tok: ["A","LearningRateSchedule","that","uses","cyclical","schedule","."]
docstr: Applies cyclical schedule to the learning rate.
  
  See Cyclical Learning Rates for Training Neural Networks. https://arxiv.org/abs/1506.01186
  
  
  ```python
  lr_schedule = tf.keras.optimizers.schedules.CyclicalLearningRate(
      initial_learning_rate=1e-4,
      maximal_learning_rate=1e-2,
      step_size=2000,
      scale_fn=lambda x: 1.,
      scale_mode="cycle",
      name="MyCyclicScheduler")
  
  model.compile(optimizer=tf.keras.optimizers.SGD(
                                              learning_rate=lr_schedule),
                loss='sparse_categorical_crossentropy',
                metrics=['accuracy'])
  
  model.fit(data, labels, epochs=5)
  ```
  
  You can pass this schedule directly into a
  `tf.keras.optimizers.legacy.Optimizer` as the learning rate.
  
  Args:
      initial_learning_rate: A scalar `float32` or `float64` `Tensor` or
          a Python number.  The initial learning rate.
      maximal_learning_rate: A scalar `float32` or `float64` `Tensor` or
          a Python number.  The maximum learning rate.
      step_size: A scalar `float32` or `float64` `Tensor` or a
          Python number. Step size denotes the number of training iterations it takes to get to maximal_learning_rate.
      scale_fn: A function. Scheduling function applied in cycle
      scale_mode: ['cycle', 'iterations']. Mode to apply during cyclic
          schedule
      name: (Optional) Name for the operation.
  
  Returns:
      Updated learning rate value.
docstr_tok: ["Applies","cyclical","schedule","to","the","learning","rate",".","See","Cyclical","Learning","Rates","for","Training","Neural","Networks",".","https",":","\/\/arxiv.org\/abs\/1506.01186","``","`","python","lr_schedule","=","tf.keras.optimizers.schedules.CyclicalLearningRate","(","initial_learning_rate=1e-4",",","maximal_learning_rate=1e-2",",","step_size=2000",",","scale_fn=lambda","x",":","1.",",","scale_mode=","''","cycle","''",",","name=","''","MyCyclicScheduler","''",")","model.compile","(","optimizer=tf.keras.optimizers.SGD","(","learning_rate=lr_schedule",")",",","loss='sparse_categorical_crossentropy","'",",","metrics=","[","'accuracy","'","]",")","model.fit","(","data",",","labels",",","epochs=5",")","``","`","You","can","pass","this","schedule","directly","into","a","`","tf.keras.optimizers.legacy.Optimizer","`","as","the","learning","rate",".","Args",":","initial_learning_rate",":","A","scalar","`","float32","`","or","`","float64","`","`","Tensor","`","or","a","Python","number",".","The","initial","learning","rate",".","maximal_learning_rate",":","A","scalar","`","float32","`","or","`","float64","`","`","Tensor","`","or","a","Python","number",".","The","maximum","learning","rate",".","step_size",":","A","scalar","`","float32","`","or","`","float64","`","`","Tensor","`","or","a","Python","number",".","Step","size","denotes","the","number","of","training","iterations","it","takes","to","get","to","maximal_learning_rate",".","scale_fn",":","A","function",".","Scheduling","function","applied","in","cycle","scale_mode",":","[","'cycle","'",",","'iterations","'","]",".","Mode","to","apply","during","cyclic","schedule","name",":","(","Optional",")","Name","for","the","operation",".","Returns",":","Updated","learning","rate","value","."]
code: def __init__(
      self,
      initial_learning_rate: Union[FloatTensorLike, Callable],
      maximal_learning_rate: Union[FloatTensorLike, Callable],
      step_size: FloatTensorLike,
      scale_fn: Callable,
      scale_mode: str = "cycle",
      name: str = "CyclicalLearningRate",
  ):
      """Applies cyclical schedule to the learning rate.
  
      See Cyclical Learning Rates for Training Neural Networks. https://arxiv.org/abs/1506.01186
  
  
      ```python
      lr_schedule = tf.keras.optimizers.schedules.CyclicalLearningRate(
          initial_learning_rate=1e-4,
          maximal_learning_rate=1e-2,
          step_size=2000,
          scale_fn=lambda x: 1.,
          scale_mode="cycle",
          name="MyCyclicScheduler")
  
      model.compile(optimizer=tf.keras.optimizers.SGD(
                                                  learning_rate=lr_schedule),
                    loss='sparse_categorical_crossentropy',
                    metrics=['accuracy'])
  
      model.fit(data, labels, epochs=5)
      ```
  
      You can pass this schedule directly into a
      `tf.keras.optimizers.legacy.Optimizer` as the learning rate.
  
      Args:
          initial_learning_rate: A scalar `float32` or `float64` `Tensor` or
              a Python number.  The initial learning rate.
          maximal_learning_rate: A scalar `float32` or `float64` `Tensor` or
              a Python number.  The maximum learning rate.
          step_size: A scalar `float32` or `float64` `Tensor` or a
              Python number. Step size denotes the number of training iterations it takes to get to maximal_learning_rate.
          scale_fn: A function. Scheduling function applied in cycle
          scale_mode: ['cycle', 'iterations']. Mode to apply during cyclic
              schedule
          name: (Optional) Name for the operation.
  
      Returns:
          Updated learning rate value.
      """
      super().__init__()
      self.initial_learning_rate = initial_learning_rate
      self.maximal_learning_rate = maximal_learning_rate
      self.step_size = step_size
      self.scale_fn = scale_fn
      self.scale_mode = scale_mode
      self.name = name
  
imports: import tensorflow
  from tensorflow_addons.utils.types import FloatTensorLike
  from typeguard import typechecked
  from typing import Union, Callable
label_desc: Use image node_id 1 to create a new CyclicalLearningRate object from inherited base classes: tf.keras.optimizers.schedules with example: obj = CyclicalLearningRate(initial_learning_rate, maximal_learning_rate, step_size, scale_fn, scale_mode, name)