docstr: Forward computations from the waveform batches to the output probabilities.
docstr_tok: ["Forward","computations","from","the","waveform","batches","to","the","output","probabilities","."]
code: def compute_forward(self, batch, stage):
      """Forward computations from the waveform batches to the output probabilities."""
      batch = batch.to(self.device)
      wavs, wav_lens = batch.sig
      phn_with_bos, phn_with_bos_lens = batch.phn_encoded_bos
  
      # Add waveform augmentation if specified.
      if stage == sb.Stage.TRAIN:
          if hasattr(self.hparams, "wav_augment"):
              wavs, wav_lens = self.hparams.wav_augment(wavs, wav_lens)
              phn_with_bos = self.hparams.wav_augment.replicate_labels(
                  phn_with_bos
              )
  
      feats = self.hparams.compute_features(wavs)
  
      # Add feature augmentation if specified.
      if stage == sb.Stage.TRAIN and hasattr(
          self.hparams, "fea_augment"
      ):
          feats, fea_lens = self.hparams.fea_augment(feats, wav_lens)
          phn_with_bos = self.hparams.fea_augment.replicate_labels(
              phn_with_bos
          )
  
      current_epoch = self.hparams.epoch_counter.current
  
      # Old models may not have the streaming hparam, we don't break them in
      # any other way so just check for its presence
      if hasattr(self.hparams, "streaming") and self.hparams.streaming:
          dynchunktrain_config = (
              self.hparams.dynchunktrain_config_sampler(stage)
          )
      else:
          dynchunktrain_config = None
  
      feats = self.modules.normalize(
          feats, wav_lens, epoch=current_epoch
      )
  
      src = self.modules.CNN(feats)
      x = self.modules.enc(
          src,
          wav_lens,
          pad_idx=self.hparams.pad_index,
          dynchunktrain_config=dynchunktrain_config,
      )
      x = self.modules.proj_enc(x)
  
      e_in = self.modules.emb(phn_with_bos)
      e_in = torch.nn.functional.dropout(
          e_in,
          self.hparams.dec_emb_dropout,
          training=(stage == sb.Stage.TRAIN),
      )
      h, _ = self.modules.dec(e_in)
      h = torch.nn.functional.dropout(
          h,
          self.hparams.dec_dropout,
          training=(stage == sb.Stage.TRAIN),
      )
      h = self.modules.proj_dec(h)
  
      # Joint network
      # add labelseq_dim to the encoder tensor: [B,T,H_enc] => [B,T,1,H_enc]
      # add timeseq_dim to the decoder tensor: [B,U,H_dec] => [B,1,U,H_dec]
      joint = self.modules.Tjoint(x.unsqueeze(2), h.unsqueeze(1))
  
      # Output layer for transducer log-probabilities
      logits_transducer = self.modules.transducer_lin(joint)
  
      # Compute outputs
      if stage == sb.Stage.TRAIN:
          p_ctc = None
          p_ce = None
  
          if self.hparams.ctc_weight > 0.0:
              # Output layer for ctc log-probabilities
              out_ctc = self.modules.proj_ctc(x)
              p_ctc = self.hparams.log_softmax(out_ctc)
  
          if self.hparams.ce_weight > 0.0:
              # Output layer for ctc log-probabilities
              p_ce = self.modules.dec_lin(h)
              p_ce = self.hparams.log_softmax(p_ce)
  
          return p_ctc, p_ce, logits_transducer, wav_lens
  
      best_hyps, scores, _, _ = self.hparams.Greedysearcher(x)
      return logits_transducer, wav_lens, best_hyps
  
file_path: speechbrain/tests/integration/ASR_ConformerTransducer_streaming/example_asr_conformertransducer_streaming_experiment.py
imports: import pathlib
  import speechbrain
  from hyperpyyaml import load_hyperpyyaml
  import torch
label_desc: Use image node_id 1 for calling the ConformerTransducerBrain obj's underlying member method code with example usage: obj.compute_forward(batch, stage) and returns: logits_transducer,  wav_lens,  best_hyps, p_ctc,  p_ce,  logits_transducer,  wav_lens