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]
  
      with torch.no_grad():
          predictions, targets = self.compute_forward(
              mixture, targets, stage
          )
          loss = self.compute_objectives(predictions, targets)
  
      # Manage audio file saving
      if stage == sb.Stage.TEST and self.hparams.save_audio:
          if hasattr(self.hparams, "n_audio_to_save"):
              if self.hparams.n_audio_to_save > 0:
                  self.save_audio(
                      snt_id[0], mixture, targets, predictions
                  )
                  self.hparams.n_audio_to_save += -1
          else:
              self.save_audio(snt_id[0], mixture, targets, predictions)
  
      return loss.mean().detach()
  
imports: import os
  import sys
  import torch
  import torch.nn.functional
  import torchaudio
  import speechbrain
  import speechbrain.nnet.schedulers
  from speechbrain.utils.distributed import run_on_main
  from hyperpyyaml import load_hyperpyyaml
  import numpy
  from tqdm import tqdm
  import csv
  import logging
  from speechbrain.core import AMPConfig
label_desc: Use image node_id 4 for calling the Separation obj's underlying member method code with example usage: obj.evaluate_batch(batch, stage) and returns: loss