'Updates the internal evaluation result.
Parameters
labels : list of `NDArray`
The labels of the data.
preds : list of `NDArray`
Predicted values.'

def update(self, labels, preds):

    check_label_shapes(labels, preds)
    for (label, pred) in zip(labels, preds):
        label = label.asnumpy()
        pred = pred.asnumpy()
        label = label.ravel()
        assert (label.shape[0] == pred.shape[0])
        prob = pred[(numpy.arange(label.shape[0]), numpy.int64(label))]
        self.sum_metric += (- numpy.log((prob + self.eps))).sum()
        self.num_inst += label.shape[0]
