docstr: Computations needed for validation/test batches
docstr_tok: ["Computations","needed","for","validation\/test","batches"]
code: def evaluate_batch(self, batch, stage):
      """Computations needed for validation/test batches"""
      # snt_id = batch.id
      mixture = batch.mix_sig
      targets = [batch.s1_sig, batch.s2_sig]
      if self.hparams.num_spks == 3:
          targets.append(batch.s3_sig)
  
      if self.hparams.use_wham_noise:
          noise = batch.noise_sig[0]
      else:
          noise = None
  
      with torch.no_grad():
          (
              predictions,
              snrhat,
              snr,
              snr_compressed,
          ) = self.compute_forward(
              mixture, targets, sb.Stage.VALID, noise
          )
  
          if self.hparams.use_snr_compression:
              snrhat = self.gettrue_snrrange(snrhat)
  
          loss = (snr - snrhat).abs().mean()
  
      return loss.detach()
  
imports: import os
  import sys
  import torch
  import speechbrain
  import speechbrain.nnet.schedulers
  from speechbrain.utils.distributed import run_on_main
  from hyperpyyaml import load_hyperpyyaml
  import itertools
  from tqdm import tqdm
  import numpy
  import logging
  import csv
  from speechbrain.core import AMPConfig
label_desc: Use image node_id 6 for calling the Separation obj's underlying member method code with example usage: obj.evaluate_batch(batch, stage) and returns: loss