class_docstr: optimizer (Optimizer): Wrapped optimizer.
  first_cycle_steps (int): First cycle step size.
  cycle_mult(float): Cycle steps magnification. Default: -1.
  max_lr(float): First cycle's max learning rate. Default: 0.1.
  min_lr(float): Min learning rate. Default: 0.001.
  warmup_steps(int): Linear warmup step size. Default: 0.
  gamma(float): Decrease rate of max learning rate by cycle. Default: 1.
  last_epoch (int): The index of last epoch. Default: -1.
class_docstr_tok: ["optimizer","(","Optimizer",")",":","Wrapped","optimizer",".","first_cycle_steps","(","int",")",":","First","cycle","step","size",".","cycle_mult","(","float",")",":","Cycle","steps","magnification",".","Default",":","-1.","max_lr","(","float",")",":","First","cycle","'s","max","learning","rate",".","Default",":","0.1.","min_lr","(","float",")",":","Min","learning","rate",".","Default",":","0.001.","warmup_steps","(","int",")",":","Linear","warmup","step","size",".","Default",":","0.","gamma","(","float",")",":","Decrease","rate","of","max","learning","rate","by","cycle",".","Default",":","1.","last_epoch","(","int",")",":","The","index","of","last","epoch",".","Default",":","-1","."]
code: def __init__(
      self,
      optimizer: torch.optim.Optimizer,
      first_cycle_steps: int,
      cycle_mult: float = 1.0,
      max_lr: float = 0.1,
      min_lr: float = 0.001,
      warmup_steps: int = 0,
      gamma: float = 1.0,
      last_epoch: int = -1,
  ):
      assert warmup_steps < first_cycle_steps
  
      self.first_cycle_steps = (
          first_cycle_steps  # first cycle step size
      )
      self.cycle_mult = cycle_mult  # cycle steps magnification
      self.base_max_lr = max_lr  # first max learning rate
      self.max_lr = max_lr  # max learning rate in the current cycle
      self.min_lr = min_lr  # min learning rate
      self.warmup_steps = warmup_steps  # warmup step size
      self.gamma = gamma  # decrease rate of max learning rate by cycle
  
      self.cur_cycle_steps = first_cycle_steps  # first cycle step size
      self.cycle = 0  # cycle count
      self.step_in_cycle = last_epoch  # step size of the current cycle
  
      super(CosineAnnealingWarmupRestarts, self).__init__(
          optimizer, last_epoch
      )
  
      # set learning rate min_lr
      self.init_lr()
  
file_path: espnet/espnet2/schedulers/cosine_anneal_warmup_restart.py
imports: import math
  import torch
  from torch.optim.lr_scheduler import _LRScheduler
  from espnet2.schedulers.abs_scheduler import AbsBatchStepScheduler
label_desc: Use image node_id 1 to create a new CosineAnnealingWarmupRestarts object from inherited base classes: _LRScheduler, AbsBatchStepScheduler with example: obj = CosineAnnealingWarmupRestarts(optimizer, first_cycle_steps, cycle_mult, max_lr, min_lr, warmup_steps, gamma, last_epoch)