class_docstr: Represents the learning rate schedule described in
  :cite:t:`https://doi.org/10.48550/arxiv.1608.03983`.
  
  **During warmup:**
  
  .. math::
      \eta_t = \eta_{base} \frac{t}{T_{warmup}}
  
  **After warmup:**
  
  .. math::
      \eta_t = \eta_{final}^i + \frac{1}{2} (\eta_{base}^i - \eta_{final}^i) (1 + \text{cos}(\pi \frac{t_{i}}{T_{i}}))
  
  where :math:`i` is the number of the current annealing cycle, :math:`t_i` is
  the number of steps taken since the last restart, and :math:`T_i` is the
  total number of steps within the :math:`i`-th cycle (i.e. *length* of the
  cycle).
  
  *Cosine Annealing* is a type of learning rate schedule that has the effect
  of starting with a large learning rate that is relatively rapidly decreased
  to a minimum value before being increased rapidly again.
  
  Please refer to the paper to learn more about the details.
  
  In addition to the original schedule, this implementation also supports a
  warmup phase where the learning rate is linearly increased for the first
  :math:`T_{warmup}` training steps to the base learning rate.
  
  .. note::
      This scheduler is not chainable.
class_docstr_tok: ["Represents","the","learning","rate","schedule","described","in",":","cite",":","t",":","`","https",":","\/\/doi.org\/10.48550\/arxiv.1608.03983","`",".","*","*","During","warmup",":","*","*","..","math",":",":","\\eta_t","=","\\eta_","{","base","}","\\frac","{","t","}","{","T_","{","warmup","}","}","*","*","After","warmup",":","*","*","..","math",":",":","\\eta_t","=","\\eta_","{","final","}","^i","+","\\frac","{","1","}","{","2","}","(","\\eta_","{","base","}","^i","-","\\eta_","{","final","}","^i",")","(","1","+","\\text","{","cos","}","(","\\pi","\\frac","{","t_","{","i","}","}","{","T_","{","i","}","}",")",")","where",":","math",":","`","i","`","is","the","number","of","the","current","annealing","cycle",",",":","math",":","`","t_i","`","is","the","number","of","steps","taken","since","the","last","restart",",","and",":","math",":","`","T_i","`","is","the","total","number","of","steps","within","the",":","math",":","`","i","`","-th","cycle","(","i.e",".","*","length","*","of","the","cycle",")",".","*","Cosine","Annealing","*","is","a","type","of","learning","rate","schedule","that","has","the","effect","of","starting","with","a","large","learning","rate","that","is","relatively","rapidly","decreased","to","a","minimum","value","before","being","increased","rapidly","again",".","Please","refer","to","the","paper","to","learn","more","about","the","details",".","In","addition","to","the","original","schedule",",","this","implementation","also","supports","a","warmup","phase","where","the","learning","rate","is","linearly","increased","for","the","first",":","math",":","`","T_","{","warmup","}","`","training","steps","to","the","base","learning","rate",".","..","note",":",":","This","scheduler","is","not","chainable","."]
code: def _cycle_lr(
      self, min_lr: float, max_lr: float, lr_mul: float, c: float
  ) -> float:
      min_lr *= lr_mul
      max_lr *= lr_mul
  
      return min_lr + 0.5 * (max_lr - min_lr) * (1 + c)
  
imports: import math
  import warnings
  from abc import ABC, abstractmethod
  from typing import List, Sequence, Union, final
  from torch.optim import Optimizer
  from torch.optim.lr_scheduler import _LRScheduler
  from typing_extensions import TypeAlias
  from fairseq2.typing import finaloverride
label_desc: Use image node_id 3 for calling the CosineAnnealingLR obj's underlying member method code with example usage: obj._cycle_lr(min_lr, max_lr, lr_mul, c) and returns: unknown