def update(self, val, n=1):
    self.val = val
    self.sum += (val * n)
    self.count += n
    self.smooth_avg = (val if (self.count == 0) else ((self.avg * self.avg_mom) + (val * (1 - self.avg_mom))))
    self.avg = (self.sum / self.count)
def update(self, val, n=1):
    self.val = val
    self.sum += (val * n)
    self.count += n
    self.smooth_avg = (val if (self.count == 0) else ((self.avg * self.avg_mom) + (val * (1 - self.avg_mom))))
    self.avg = (self.sum / self.count)