def compute_loss(self):
        """Compute loss function. Iterate over multiple output"""
        preds = self.predictions
        weights = self.weight
        if not isinstance(preds, collections.Sequence):
            preds = [preds]
            weights = [1]

        loss = 0
        for lmda, prediction in zip(weights, preds):
            if lmda == 0:
                continue
            loss += lmda * self.criterion(prediction, self.target)

        self.loss = loss
Compute loss function. Iterate over multiple output
models/aggregated_classifier.py