class_docstr: Anneals the learning rate.
code: def __init__(
      self,
      optimizer,
      max_lr,
      min_lr,
      warmup_steps,
      decay_tokens,
      decay_style,
      use_checkpoint_lr_scheduler=True,
      override_lr_scheduler=False,
  ):
      # Class values.
      self.optimizer = optimizer
  
      self.max_lr = float(max_lr)
      self.min_lr = min_lr
      assert self.min_lr >= 0.0
      assert self.max_lr >= self.min_lr
      self.cur_lr = 0
  
      self.warmup_steps = warmup_steps
      self.num_steps = 0
      self.decay_tokens = decay_tokens
      self.consumed_tokens = 0
      self.warmup_tokens = 0
  
      self.decay_style = decay_style
  
      self.override_lr_scheduler = override_lr_scheduler
      self.use_checkpoint_lr_scheduler = use_checkpoint_lr_scheduler
      if self.override_lr_scheduler:
          assert not self.use_checkpoint_lr_scheduler, (
              "both override and " "use-checkpoint are set."
          )
  
      # Set the learning rate
      self.step(0, 0)
  
file_path: deepspeedexamples/training/data_efficiency/gpt_finetuning/learning_rates.py
imports: import math
label_desc: Use image node_id 1 to create a new AnnealingLR object from inherited base classes: object with example: obj = AnnealingLR(optimizer, max_lr, min_lr, warmup_steps, decay_tokens, decay_style, use_checkpoint_lr_scheduler, override_lr_scheduler)