class_docstr: Cosine annealing with restarts learning rate scheme.
  
  Args:
      periods (list[int]): Periods for each cosine anneling cycle.
      restart_weights (list[float], optional): Restart weights at each
          restart iteration. Default: [1].
      min_lr (float, optional): The minimum lr. Default: None.
      min_lr_ratio (float, optional): The ratio of minimum lr to the base lr.
          Either `min_lr` or `min_lr_ratio` should be specified.
          Default: None.
code: def __init__(
      self,
      periods,
      restart_weights=[1],
      min_lr=None,
      min_lr_ratio=None,
      **kwargs,
  ):
      assert (min_lr is None) ^ (min_lr_ratio is None)
      self.periods = periods
      self.min_lr = min_lr
      self.min_lr_ratio = min_lr_ratio
      self.restart_weights = restart_weights
      assert len(self.periods) == len(
          self.restart_weights
      ), "periods and restart_weights should have the same length."
      super(CosineRestartLrUpdaterHook, self).__init__(**kwargs)
  
      self.cumulative_periods = [
          sum(self.periods[0 : i + 1])
          for i in range(0, len(self.periods))
      ]
  
imports: import numbers
  from math import cos, pi
  import annotator.uniformer.mmcv
  from .hook import HOOKS, Hook
label_desc: Use image node_id 1 to create a new CosineRestartLrUpdaterHook object from inherited base classes: LrUpdaterHook with example: obj = CosineRestartLrUpdaterHook(periods, restart_weights, min_lr, min_lr_ratio)