docstr: Given the network predictions and targets computed the CTC loss.
docstr_tok: ["Given","the","network","predictions","and","targets","computed","the","CTC","loss","."]
code: def compute_objectives(self, predictions, batch, stage):
      "Given the network predictions and targets computed the CTC loss."
      pout, pout_lens = predictions
      phns, phn_lens = batch.phn_encoded
      # Label Augmentation
      if stage == sb.Stage.TRAIN and hasattr(
          self.hparams, "wav_augment"
      ):
          phns = self.hparams.wav_augment.replicate_labels(phns)
          phn_lens = self.hparams.wav_augment.replicate_labels(phn_lens)
      loss = self.hparams.compute_cost(pout, phns, pout_lens, phn_lens)
      self.ctc_metrics.append(batch.id, pout, phns, pout_lens, phn_lens)
  
      if stage != sb.Stage.TRAIN:
          sequence = sb.decoders.ctc_greedy_decode(
              pout, pout_lens, blank_id=self.hparams.blank_index
          )
          self.per_metrics.append(
              ids=batch.id,
              predict=sequence,
              target=phns,
              target_len=phn_lens,
              ind2lab=self.label_encoder.decode_ndim,
          )
  
      return loss
  
file_path: speechbrain/recipes/Voicebank/ASR/CTC/train.py
imports: import os
  import sys
  import torch
  import speechbrain
  from speechbrain.utils.distributed import run_on_main
  from hyperpyyaml import load_hyperpyyaml
label_desc: Use image node_id 2 for calling the ASR_Brain obj's underlying member method code with example usage: obj.compute_objectives(predictions, batch, stage) and returns: loss