class_docstr: Exponential Moving Average Hook.
  
  Use Exponential Moving Average on all parameters of model in training
  process. All parameters have a ema backup, which update by the formula
  as below. EMAHook takes priority over EvalHook and CheckpointSaverHook.
  
      .. math::
  
          \text{Xema\_{t+1}} = (1 - \text{momentum}) \times
          \text{Xema\_{t}} +  \text{momentum} \times X_t
  
  Args:
      momentum (float): The momentum used for updating ema parameter.
          Defaults to 0.0002.
      interval (int): Update ema parameter every interval iteration.
          Defaults to 1.
      warm_up (int): During first warm_up steps, we may use smaller momentum
          to update ema parameters more slowly. Defaults to 100.
      resume_from (str): The checkpoint path. Defaults to None.
docstr: Update ema parameter every self.interval iterations.
docstr_tok: ["Update","ema","parameter","every","self.interval","iterations","."]
code: def after_train_iter(self, runner):
      """Update ema parameter every self.interval iterations."""
      curr_step = runner.iter
      # We warm up the momentum considering the instability at beginning
      momentum = min(
          self.momentum, (1 + curr_step) / (self.warm_up + curr_step)
      )
      if curr_step % self.interval != 0:
          return
      for name, parameter in self.model_parameters.items():
          buffer_name = self.param_ema_buffer[name]
          buffer_parameter = self.model_buffers[buffer_name]
          buffer_parameter.mul_(1 - momentum).add_(
              momentum, parameter.data
          )
  
file_path: lavis/lavis/common/annotator/uniformer/mmcv/runner/hooks/ema.py
imports: from ...parallel import is_module_wrapper
  from ..hooks.hook import HOOKS, Hook
label_desc: Use image node_id 3 for calling the EMAHook obj's underlying member method code with example usage: obj.after_train_iter(runner) without return types