def METHOD_NAME(self, predictions, batch, stage):
    "Given the network predictions and targets computed the CTC loss."
    phns, phn_lens = batch.phn_encoded
    if stage == sb.Stage.TRAIN:
        predictions, lens = predictions
    else:
        predictions, lens, seq = predictions
        self.per_metrics.append(batch.id, seq, phns, target_len=phn_lens)
    loss = self.hparams.compute_cost(
        predictions,
        phns.to(self.device).long(),
        lens,
        phn_lens.to(self.device),
    )
    return loss