Calculate value of a metric

def calculate(self, batch_info):
        """ Calculate value of a metric """
        value = self._value_function(batch_info['data'], batch_info['target'], batch_info['output'])
        self.storage.append(value)