code: def __init__(
      self,
      base_optimizer: Optimizer,
      init_lr: float,
      max_lr: float,
      n_warmup_steps: int,
      max_steps: int,
  ):
      super().__init__(base_optimizer, init_lr)
      self.n_warmup_steps = n_warmup_steps
      self.half_delta = (max_lr - init_lr) / 2
  
      self.warmup_k = (max_lr - init_lr) / n_warmup_steps
      self.decay_k = np.pi / (max_steps - n_warmup_steps)
  
imports: import numpy
  from torch.optim import Optimizer
  from typing import Tuple
label_desc: Use image node_id 1 to create a new CosineScheduler object from inherited base classes: AbstractScheduler with example: obj = CosineScheduler(base_optimizer, init_lr, max_lr, n_warmup_steps, max_steps)