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