class_docstr: maintains an exponential moving average
code: def update(self, f_new):
      if not self.initialized:
          self.reset(f_new)
      else:
          self.fs.append(f_new)
          self.f_ma.append(
              self.f_ma[-1] * (1 - self.gamma) + self.gamma * f_new
          )
          if self.num_updates() > self.valid_after:
              self.rel_change.append(
                  np.abs(
                      (self.f_ma[-1] - self.f_ma[-2]) / self.f_ma[-2]
                  )
              )
  
file_path: nni/nni/algorithms/feature_engineering/gradient_selector/utils.py
imports: import numpy
label_desc: Use image node_id 4 for calling the EMA obj's underlying member method code with example usage: obj.update(f_new) without return types