def METHOD_NAME(self, predictions, batch, stage):
    "Given the network predictions and targets computed the NLL loss."
    if stage == sb.Stage.TRAIN:
        outputs = predictions
    else:
        outputs, seq = predictions
    phns, phn_lens = batch.phn_encoded_eos
    loss = self.hparams.compute_cost(outputs, phns, length=phn_lens)
    if stage != sb.Stage.TRAIN:
        self.per_metrics.append(batch.id, seq, phns, target_len=phn_lens)
    return loss