class_docstr: Class for sound class embedding training" 
class_docstr_tok: ["Class","for","sound","class","embedding","training","''"]
docstr: Computation pipeline based on a encoder + sound classifier.
  Data augmentation and environmental corruption are applied to the
  input sound.
docstr_tok: ["Computation","pipeline","based","on","a","encoder","+","sound","classifier",".","Data","augmentation","and","environmental","corruption","are","applied","to","the","input","sound","."]
code: def compute_forward(self, batch, stage):
      """Computation pipeline based on a encoder + sound classifier.
      Data augmentation and environmental corruption are applied to the
      input sound.
      """
      batch = batch.to(self.device)
      wavs, lens = batch.sig
  
      X_stft_logpower, X_stft, X_stft_power = self.preprocess(wavs)
  
      # Embeddings + sound classifier
      (
          hcat,
          embeddings,
          predictions,
          class_pred,
      ) = self.classifier_forward(X_stft_logpower)
  
      if self.hparams.use_vq:
          xhat, hcat, z_q_x = self.modules.psi(hcat, class_pred)
      else:
          xhat = self.modules.psi.decoder(hcat)
  
          z_q_x = None
  
      xhat = xhat.squeeze(1)
  
      if self.hparams.use_mask_output:
          xhat = F.sigmoid(xhat)
      else:
          xhat = F.softplus(xhat)
  
      garbage = 0
  
      if stage == sb.Stage.VALID:
          # save some samples
          if (
              self.hparams.epoch_counter.current
              % self.hparams.interpret_period
          ) == 0 and self.hparams.save_interpretations:
              wavs = wavs[0].unsqueeze(0)
              self.interpret_sample(wavs, batch)
              self.overlap_test(batch)
              self.debug_files(
                  X_stft, xhat, X_stft_logpower, batch, wavs
              )
  
      return predictions, xhat, hcat, z_q_x, garbage
  
imports: import os
  import sys
  import torch
  import torchaudio
  import speechbrain
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.distributed import run_on_main
  from esc50_prepare import prepare_esc50
  from speechbrain.utils.metric_stats import MetricStats
  from os import makedirs
  import torch.nn.functional
  from speechbrain.processing.NMF import spectral_phase
  import matplotlib.pyplot
label_desc: Use image node_id 8 for calling the InterpreterESC50Brain obj's underlying member method code with example usage: obj.compute_forward(batch, stage) and returns: predictions,  xhat,  hcat,  z_q_x,  garbage