class_docstr: This class implements the interface for the PIQ posthoc interpreter for an audio classifier.
  
  Example
  -------
  >>> from speechbrain.inference.interpretability import PIQAudioInterpreter
  >>> tmpdir = getfixture("tmpdir")
  >>> interpreter = PIQAudioInterpreter.from_hparams(
  ...     source="speechbrain/PIQ-ESC50",
  ...     savedir=tmpdir,
  ... )
  >>> signal = torch.randn(1, 16000)
  >>> interpretation, _ = interpreter.interpret_batch(signal)
class_docstr_tok: ["This","class","implements","the","interface","for","the","PIQ","posthoc","interpreter","for","an","audio","classifier",".","Example","--","--","--","-",">",">",">","from","speechbrain.inference.interpretability","import","PIQAudioInterpreter",">",">",">","tmpdir","=","getfixture","(","``","tmpdir","''",")",">",">",">","interpreter","=","PIQAudioInterpreter.from_hparams","(","...","source=","''","speechbrain\/PIQ-ESC50","''",",","...","savedir=tmpdir",",","...",")",">",">",">","signal","=","torch.randn","(","1",",","16000",")",">",">",">","interpretation",",","_","=","interpreter.interpret_batch","(","signal",")"]
docstr: Classifies the given audio into the given set of labels.
  It also provides the interpretation in the audio domain.
  
  Arguments
  ---------
  wavs : torch.Tensor
      Batch of waveforms [batch, time, channels] or [batch, time]
      depending on the model. Make sure the sample rate is fs=16000 Hz.
  
  Returns
  -------
  x_int_sound_domain
      The interpretation in the waveform domain
  text_lab:
      The text label for the classification
  fs_model:
      The sampling frequency of the model. Useful to save the audio.
docstr_tok: ["Classifies","the","given","audio","into","the","given","set","of","labels",".","It","also","provides","the","interpretation","in","the","audio","domain",".","Arguments","--","--","--","--","-","wavs",":","torch.Tensor","Batch","of","waveforms","[","batch",",","time",",","channels","]","or","[","batch",",","time","]","depending","on","the","model",".","Make","sure","the","sample","rate","is","fs=16000","Hz",".","Returns","--","--","--","-","x_int_sound_domain","The","interpretation","in","the","waveform","domain","text_lab",":","The","text","label","for","the","classification","fs_model",":","The","sampling","frequency","of","the","model",".","Useful","to","save","the","audio","."]
code: def interpret_batch(self, wavs):
      """Classifies the given audio into the given set of labels.
      It also provides the interpretation in the audio domain.
  
      Arguments
      ---------
      wavs : torch.Tensor
          Batch of waveforms [batch, time, channels] or [batch, time]
          depending on the model. Make sure the sample rate is fs=16000 Hz.
  
      Returns
      -------
      x_int_sound_domain
          The interpretation in the waveform domain
      text_lab:
          The text label for the classification
      fs_model:
          The sampling frequency of the model. Useful to save the audio.
      """
      wavs = wavs.to(self.device)
      X_stft_logpower, X_stft, X_stft_power = self.preprocess(wavs)
      X_stft_phase = spectral_phase(X_stft)
  
      # 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.mods.psi(hcat, class_pred)
      else:
          xhat = self.mods.psi.decoder(hcat)
      xhat = xhat.squeeze(1)
      Tmax = xhat.shape[1]
      if self.hparams.use_mask_output:
          xhat = F.sigmoid(xhat)
          X_int = xhat * X_stft_logpower[:, :Tmax, :]
      else:
          xhat = F.softplus(xhat)
          th = xhat.max() * self.hparams.mask_th
          X_int = (xhat > th) * X_stft_logpower[:, :Tmax, :]
      X_int = torch.expm1(X_int)
      x_int_sound_domain = self.invert_stft_with_phase(
          X_int, X_stft_phase
      )
      text_lab = self.hparams.label_encoder.decode_torch(
          class_pred.unsqueeze(0)
      )
  
      return x_int_sound_domain, text_lab
  
file_path: speechbrain/speechbrain/inference/interpretability.py
imports: import torch
  import torchaudio
  import torch.nn.functional
  import speechbrain
  from speechbrain.utils.fetching import fetch
  from speechbrain.utils.data_utils import split_path
  from speechbrain.processing.NMF import spectral_phase
  from speechbrain.inference.interfaces import Pretrained
label_desc: Use image node_id 5 for calling the PIQAudioInterpreter obj's underlying member method code with example usage: obj.interpret_batch(wavs) and returns: x_int_sound_domain,  text_lab