'Accumulate the predictions and their ground truth labels.
Args:
predictions: A list of lists storing the prediction scores. The outer
dimension corresponds to classes.
actuals: A list of lists storing the ground truth labels. The dimensions
should correspond to the predictions input. Any value
larger than 0 will be treated as positives, otherwise as negatives.
num_positives: If provided, it is a list of numbers representing the
number of true positives for each class. If not provided, the number of
true positives will be inferred from the \'actuals\' array.
Raises:
ValueError: An error occurred when the shape of predictions and actuals
does not match.'

def accumulate(self, predictions, actuals, num_positives=None):

    if (not num_positives):
        num_positives = [None for i in predictions.shape[1]]
    calculators = self._ap_calculators
    for i in range(len(predictions)):
        calculators[i].accumulate(predictions[i], actuals[i], num_positives[i])
