class_docstr: maintains an exponential moving average
code: def __init__(
      self,
      f=np.nan,
      discount_factor=0.1,
      valid_after=None,
      n_iters_relchange=3,
  ):
      self.f_ma = [f]
      self.fs = [f]
      self.gamma = discount_factor
      self.rel_change = [np.nan]
      if valid_after is None:
          self.valid_after = int(1 / discount_factor)
      else:
          self.valid_after = valid_after
      self.n_iters_relchange = n_iters_relchange
      self.initialized = False
  
file_path: nni/nni/algorithms/feature_engineering/gradient_selector/utils.py
imports: import numpy
label_desc: Use image node_id 1 to create a new EMA object  with example: obj = EMA(f, discount_factor, valid_after, n_iters_relchange)