original_docstring: Computations from the waveform to the output probabilities.
docstring: Computations from the waveform to the output probabilities.
docstring_tokens: Computations from the waveform to the output probabilities .
code: def compute_forward(self, batch, stage):
          """Computations from the waveform to the output probabilities."""
          batch = batch.to(self.device)
          wavs, wav_lens = batch.sig
  
          # Adding augmentation when specified:
          if stage == sb.Stage.TRAIN:
              if hasattr(self.modules, "env_corrupt"):
                  wavs_noise = self.modules.env_corrupt(wavs, wav_lens)
                  wavs = torch.cat([wavs, wavs_noise], dim=0)
                  wav_lens = torch.cat([wav_lens, wav_lens])
              if hasattr(self.hparams, "augmentation"):
                  wavs = self.hparams.augmentation(wavs, wav_lens)
  
          feats = self.hparams.compute_features(wavs)
          if hasattr(self.hparams, "normalize"):
              feats = self.modules.normalize(feats, wav_lens)
          out = self.modules.model(feats)
          out = self.modules.output(out)
          out = out - out.mean(1).unsqueeze(1)
          pout = self.hparams.log_softmax(out)
          return pout, wav_lens
code_tokens: def compute_forward ( self , batch , stage ) : batch = batch . to ( self . device ) wavs , wav_lens = batch . sig if stage == sb . Stage . TRAIN : if hasattr ( self . modules , "env_corrupt" ) : wavs_noise = self . modules . env_corrupt ( wavs , wav_lens ) wavs = torch . cat ( [ wavs , wavs_noise ] , dim = 0 ) wav_lens = torch . cat ( [ wav_lens , wav_lens ] ) if hasattr ( self . hparams , "augmentation" ) : wavs = self . hparams . augmentation ( wavs , wav_lens ) feats = self . hparams . compute_features ( wavs ) if hasattr ( self . hparams , "normalize" ) : feats = self . modules . normalize ( feats , wav_lens ) out = self . modules . model ( feats ) out = self . modules . output ( out ) out = out - out . mean ( 1 ) . unsqueeze ( 1 ) pout = self . hparams . log_softmax ( out ) return pout , wav_lens
short_docstring: Computations from the waveform to the output probabilities.
short_docstring_tokens: Computations from the waveform to the output probabilities .
comment: """Computations from the waveform to the output probabilities."""$SEP$# Adding augmentation when specified: