class_docstr: Cosine learning rate scheduler: https://arxiv.org/abs/1608.03983
code: def __init__(self, opts, **kwargs) -> None:
      is_iter_based = getattr(
          opts, "scheduler.is_iteration_based", True
      )
      super(CosineScheduler, self).__init__(opts=opts)
  
      max_iterations = getattr(opts, "scheduler.max_iterations", 150000)
  
      self.min_lr = getattr(opts, "scheduler.cosine.min_lr", 1e-5)
      self.max_lr = getattr(opts, "scheduler.cosine.max_lr", 0.4)
  
      if self.warmup_iterations > 0:
          self.warmup_step = (
              self.max_lr - self.warmup_init_lr
          ) / self.warmup_iterations
  
      self.period = (
          max_iterations - self.warmup_iterations + 1
          if is_iter_based
          else getattr(opts, "scheduler.max_epochs", 350)
      )
  
      self.is_iter_based = is_iter_based
  
file_path: ml-cvnets/optim/scheduler/cosine.py
imports: import argparse
  import math
  from optim.scheduler import SCHEDULER_REGISTRY
  from optim.scheduler.base_scheduler import BaseLRScheduler
label_desc: Use image node_id 1 to create a new CosineScheduler object from inherited base classes: BaseLRScheduler with example: obj = CosineScheduler(opts)