class_docstr: Class that manages the training loop. See speechbrain.core.Brain.
class_docstr_tok: ["Class","that","manages","the","training","loop",".","See","speechbrain.core.Brain","."]
docstr: Runs all the computation of that transforms the input into the
  output probabilities over the N classes.
  
  Arguments
  ---------
  batch : PaddedBatch
      This batch object contains all the relevant tensors for computation.
  stage : sb.Stage
      One of sb.Stage.TRAIN, sb.Stage.VALID, or sb.Stage.TEST.
  
  Returns
  -------
  predictions : Tensor
      Tensor that contains the posterior probabilities over the N classes.
docstr_tok: ["Runs","all","the","computation","of","that","transforms","the","input","into","the","output","probabilities","over","the","N","classes",".","Arguments","--","--","--","--","-","batch",":","PaddedBatch","This","batch","object","contains","all","the","relevant","tensors","for","computation",".","stage",":","sb.Stage","One","of","sb.Stage.TRAIN",",","sb.Stage.VALID",",","or","sb.Stage.TEST",".","Returns","--","--","--","-","predictions",":","Tensor","Tensor","that","contains","the","posterior","probabilities","over","the","N","classes","."]
code: def compute_forward(self, batch, stage):
      """Runs all the computation of that transforms the input into the
      output probabilities over the N classes.
  
      Arguments
      ---------
      batch : PaddedBatch
          This batch object contains all the relevant tensors for computation.
      stage : sb.Stage
          One of sb.Stage.TRAIN, sb.Stage.VALID, or sb.Stage.TEST.
  
      Returns
      -------
      predictions : Tensor
          Tensor that contains the posterior probabilities over the N classes.
      """
  
      # We first move the batch to the appropriate device.
      batch = batch.to(self.device)
  
      # Compute features, embeddings, and predictions
      feats, lens = self.prepare_features(batch.sig, stage)
      embeddings = self.modules.embedding_model(feats, lens)
      predictions = self.modules.classifier(embeddings)
  
      return predictions
  
file_path: speechbrain/templates/speaker_id/train.py
imports: import os
  import sys
  import speechbrain
  from hyperpyyaml import load_hyperpyyaml
  from mini_librispeech_prepare import prepare_mini_librispeech
label_desc: Use image node_id 1 for calling the SpkIdBrain obj's underlying member method code with example usage: obj.compute_forward(batch, stage) and returns: predictions