class_docstr: LR Scheduler in MMCV.
  
  Args:
      by_epoch (bool): LR changes epoch by epoch
      warmup (string): Type of warmup used. It can be None(use no warmup),
          'constant', 'linear' or 'exp'
      warmup_iters (int): The number of iterations or epochs that warmup
          lasts
      warmup_ratio (float): LR used at the beginning of warmup equals to
          warmup_ratio * initial_lr
      warmup_by_epoch (bool): When warmup_by_epoch == True, warmup_iters
          means the number of epochs that warmup lasts, otherwise means the
          number of iteration that warmup lasts
code: def before_run(self, runner):
      # NOTE: when resuming from a checkpoint, if 'initial_lr' is not saved,
      # it will be set according to the optimizer params
      if isinstance(runner.optimizer, dict):
          self.base_lr = {}
          for k, optim in runner.optimizer.items():
              for group in optim.param_groups:
                  group.setdefault("initial_lr", group["lr"])
              _base_lr = [
                  group["initial_lr"] for group in optim.param_groups
              ]
              self.base_lr.update({k: _base_lr})
      else:
          for group in runner.optimizer.param_groups:
              group.setdefault("initial_lr", group["lr"])
          self.base_lr = [
              group["initial_lr"]
              for group in runner.optimizer.param_groups
          ]
  
imports: import numbers
  from math import cos, pi
  import annotator.uniformer.mmcv
  from .hook import HOOKS, Hook
label_desc: Use image node_id 6 for calling the LrUpdaterHook obj's underlying member method code with example usage: obj.before_run(runner) without return types