def update(self, val: float, n: int = 1):
        """
        Update loss tracker
        :param val: Loss value to add to tracker
        :param n: Number of elements contributing to val
        """
        self.val = val
        self.sum += val * n
        self.count += n
        self.avg = self.sum / self.count

        Update loss tracker
        :param val: Loss value to add to tracker
        :param n: Number of elements contributing to val
        
art/attacks/poisoning/hidden_trigger_backdoor/loss_meter.py