docstr: Given an input batch computes the enhanced signal
docstr_tok: ["Given","an","input","batch","computes","the","enhanced","signal"]
code: def compute_forward(self, batch, stage):
      "Given an input batch computes the enhanced signal"
      batch = batch.to(self.device)
  
      if self.sub_stage == SubStage.HISTORICAL:
          predict_wav, lens = batch.enh_sig
      else:
          noisy_wav, lens = batch.noisy_sig
          noisy_spec = self.compute_feats(noisy_wav)
  
          # mask with "signal approximation (SA)"
          mask = self.modules.generator(noisy_spec, lengths=lens)
          mask = mask.clamp(min=self.hparams.min_mask).squeeze(2)
          predict_spec = torch.mul(mask, noisy_spec)
  
          # Also return predicted wav
          predict_wav = self.hparams.resynth(
              torch.expm1(predict_spec), noisy_wav
          )
  
      return predict_wav
  
imports: import os
  import sys
  import shutil
  import pickle
  import torch
  import torchaudio
  import speechbrain
  from pesq import pesq
  from enum import Enum, auto
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.metric_stats import MetricStats
  from speechbrain.processing.features import spectral_magnitude
  from speechbrain.nnet.loss.stoi_loss import stoi_loss
  from speechbrain.utils.distributed import run_on_main
  from speechbrain.dataio.sampler import ReproducibleWeightedRandomSampler
label_desc: Use image node_id 3 for calling the MetricGanBrain obj's underlying member method code with example usage: obj.compute_forward(batch, stage) and returns: predict_wav