class_docstr: For a given model, this class computes the exponential moving average of weights
  
  Args:
      model (torch.nn.Module): Model
      ema_momentum (Optional[float]): Momentum value shows the contribution of weights at current iteration. Default: 0.0005
      device (Optional[str]): Device (CPU or GPU) on which model resides. Default: cpu
code: def __init__(
      self,
      model: nn.Module,
      ema_momentum: Optional[float] = 0.0005,
      device: Optional[str] = "cpu",
      *args,
      **kwargs,
  ) -> None:
      # make a deep copy of the model for accumulating moving average of parameters and set to eval mode
      self.ema_model = deepcopy(model)
      self.ema_model.eval()
      self.momentum = ema_momentum
      self.device = device
      if device:
          self.ema_model.to(device=device)
      self.ema_has_module = hasattr(self.ema_model, "module")
      for param in self.ema_model.parameters():
          param.requires_grad = False
  
file_path: ml-cvnets/cvnets/misc/averaging_utils.py
imports: import argparse
  from copy import deepcopy
  from typing import Optional
  import torch
  from torch import nn
label_desc: Use image node_id 1 to create a new EMA object from inherited base classes: object with example: obj = EMA(model, ema_momentum, device)