class_docstr: Cyclic LR: https://arxiv.org/abs/1811.11431
class_docstr_tok: ["Cyclic","LR",":","https",":","\/\/arxiv.org\/abs\/1811.11431"]
code: def get_lr(self, epoch: int, curr_iter: int) -> float:
      if curr_iter < self.warmup_iterations:
          curr_lr = self.warmup_init_lr + curr_iter * self.warmup_step
      else:
          if epoch <= self.cyclic_epochs:
              if (
                  epoch in self.steps
                  and epoch not in self.epochs_lr_stepped
              ):
                  self.min_lr *= self.gamma ** (
                      self.steps.index(epoch) + 1
                  )
                  self.max_lr *= self.gamma ** (
                      self.steps.index(epoch) + 1
                  )
                  self._lr_per_cycle()
                  self.epochs_lr_stepped.append(epoch)
              idx = epoch % self.cycle_length
              curr_lr = self.cycle_lrs[idx]
          else:
              base_lr = self.min_lr
              if self.last_cycle_anneal_type == "linear":
                  lr_step = (
                      base_lr - self.end_lr
                  ) / self.last_cycle_epochs
                  curr_lr = (
                      base_lr
                      - (epoch - self.cyclic_epochs + 1) * lr_step
                  )
              elif self.last_cycle_anneal_type == "cosine":
                  curr_epoch = epoch - self.cyclic_epochs
                  period = self.max_epochs - self.cyclic_epochs + 1
                  curr_lr = self.end_lr + 0.5 * (
                      base_lr - self.end_lr
                  ) * (1 + math.cos(math.pi * curr_epoch / period))
              else:
                  raise NotImplementedError
      return max(0.0, curr_lr)
  
file_path: ml-cvnets/optim/scheduler/cyclic.py
imports: import argparse
  import math
  import numpy
  from optim.scheduler import SCHEDULER_REGISTRY
  from optim.scheduler.base_scheduler import BaseLRScheduler
  from utils import logger
label_desc: Use image node_id 4 for calling the CyclicLRScheduler obj's underlying member method code with example usage: obj.get_lr(epoch, curr_iter) and returns: max