class_docstr: OneCycle momentum Scheduler.
  
  This momentum scheduler usually used together with the OneCycleLrUpdater
  to improve the performance.
  
  Args:
      base_momentum (float or list): Lower momentum boundaries in the cycle
          for each parameter group. Note that momentum is cycled inversely
          to learning rate; at the peak of a cycle, momentum is
          'base_momentum' and learning rate is 'max_lr'.
          Default: 0.85
      max_momentum (float or list): Upper momentum boundaries in the cycle
          for each parameter group. Functionally,
          it defines the cycle amplitude (max_momentum - base_momentum).
          Note that momentum is cycled inversely
          to learning rate; at the start of a cycle, momentum is
          'max_momentum' and learning rate is 'base_lr'
          Default: 0.95
      pct_start (float): The percentage of the cycle (in number of steps)
          spent increasing the learning rate.
          Default: 0.3
      anneal_strategy (str): {'cos', 'linear'}
          Specifies the annealing strategy: 'cos' for cosine annealing,
          'linear' for linear annealing.
          Default: 'cos'
      three_phase (bool): If three_phase is True, use a third phase of the
          schedule to annihilate the learning rate according to
          final_div_factor instead of modifying the second phase (the first
          two phases will be symmetrical about the step indicated by
          pct_start).
          Default: False
class_docstr_tok: ["OneCycle","momentum","Scheduler",".","This","momentum","scheduler","usually","used","together","with","the","OneCycleLrUpdater","to","improve","the","performance",".","Args",":","base_momentum","(","float","or","list",")",":","Lower","momentum","boundaries","in","the","cycle","for","each","parameter","group",".","Note","that","momentum","is","cycled","inversely","to","learning","rate",";","at","the","peak","of","a","cycle",",","momentum","is","'base_momentum","'","and","learning","rate","is","'max_lr","'",".","Default",":","0.85","max_momentum","(","float","or","list",")",":","Upper","momentum","boundaries","in","the","cycle","for","each","parameter","group",".","Functionally",",","it","defines","the","cycle","amplitude","(","max_momentum","-","base_momentum",")",".","Note","that","momentum","is","cycled","inversely","to","learning","rate",";","at","the","start","of","a","cycle",",","momentum","is","'max_momentum","'","and","learning","rate","is","'base_lr'","Default",":","0.95","pct_start","(","float",")",":","The","percentage","of","the","cycle","(","in","number","of","steps",")","spent","increasing","the","learning","rate",".","Default",":","0.3","anneal_strategy","(","str",")",":","{","'cos","'",",","'linear","'","}","Specifies","the","annealing","strategy",":","'cos","'","for","cosine","annealing",",","'linear","'","for","linear","annealing",".","Default",":","'cos'","three_phase","(","bool",")",":","If","three_phase","is","True",",","use","a","third","phase","of","the","schedule","to","annihilate","the","learning","rate","according","to","final_div_factor","instead","of","modifying","the","second","phase","(","the","first","two","phases","will","be","symmetrical","about","the","step","indicated","by","pct_start",")",".","Default",":","False"]
code: def get_regular_momentum(self, runner):
      if isinstance(runner.optimizer, dict):
          momentum_groups = {}
          for k, optim in runner.optimizer.items():
              _momentum_group = [
                  self.get_momentum(runner, param_group)
                  for param_group in optim.param_groups
              ]
              momentum_groups.update({k: _momentum_group})
          return momentum_groups
      else:
          momentum_groups = []
          for param_group in runner.optimizer.param_groups:
              momentum_groups.append(
                  self.get_momentum(runner, param_group)
              )
          return momentum_groups
  
imports: import annotator.uniformer.mmcv
  from .hook import HOOKS, Hook
  from .lr_updater import annealing_cos, annealing_linear, format_param
label_desc: Use image node_id 5 for calling the OneCycleMomentumUpdaterHook obj's underlying member method code with example usage: obj.get_regular_momentum(runner) and returns: momentum_groups, momentum_groups