docstr: Fit one batch, override to do multiple updates.
  
  The default implementation depends on a few methods being defined
  with a particular behavior:
  
  * ``compute_forward()``
  * ``compute_objectives()``
  
  Also depends on having optimizers passed at initialization.
  
  Arguments
  ---------
  batch : list of torch.Tensors
      Batch of data to use for training. Default implementation assumes
      this batch has two elements: inputs and targets.
  
  Returns
  -------
  detached loss
docstr_tok: ["Fit","one","batch",",","override","to","do","multiple","updates",".","The","default","implementation","depends","on","a","few","methods","being","defined","with","a","particular","behavior",":","*","``","compute_forward","(",")","``","*","``","compute_objectives","(",")","``","Also","depends","on","having","optimizers","passed","at","initialization",".","Arguments","--","--","--","--","-","batch",":","list","of","torch.Tensors","Batch","of","data","to","use","for","training",".","Default","implementation","assumes","this","batch","has","two","elements",":","inputs","and","targets",".","Returns","--","--","--","-","detached","loss"]
code: def fit_batch(self, batch):
      """Fit one batch, override to do multiple updates.
  
      The default implementation depends on a few methods being defined
      with a particular behavior:
  
      * ``compute_forward()``
      * ``compute_objectives()``
  
      Also depends on having optimizers passed at initialization.
  
      Arguments
      ---------
      batch : list of torch.Tensors
          Batch of data to use for training. Default implementation assumes
          this batch has two elements: inputs and targets.
  
      Returns
      -------
      detached loss
      """
      noisy_wavs, lens = batch.noisy_sig
      clean_wavs, lens = batch.clean_sig
  
      # split sentences in smaller chunks
      noisy_wavs = create_chunks(
          noisy_wavs,
          chunk_size=hparams["chunk_size"],
          chunk_stride=hparams["chunk_stride"],
      )
      clean_wavs = create_chunks(
          clean_wavs,
          chunk_size=hparams["chunk_size"],
          chunk_stride=hparams["chunk_stride"],
      )
  
      # first of three step training process detailed in SEGAN paper
      out_d1 = self.compute_forward_d(noisy_wavs, clean_wavs)
      loss_d1 = self.compute_objectives_d1(out_d1, batch)
      loss_d1.backward()
      torch.nn.utils.clip_grad_norm_(
          self.modules.parameters(), self.max_grad_norm
      )
      self.optimizer_d.step()
      self.optimizer_d.zero_grad()
  
      # second training step
      z_mean = None
      z_logvar = None
      if self.modules["model_g"].latent_vae:
          out_g2, z_mean, z_logvar = self.compute_forward_g(noisy_wavs)
      else:
          out_g2 = self.compute_forward_g(noisy_wavs)
      out_d2 = self.compute_forward_d(out_g2, clean_wavs)
      loss_d2 = self.compute_objectives_d2(out_d2, batch)
      loss_d2.backward(retain_graph=True)
      torch.nn.utils.clip_grad_norm_(
          self.modules.parameters(), self.max_grad_norm
      )
      self.optimizer_d.step()
      self.optimizer_d.zero_grad()
  
      # third (last) training step
      self.optimizer_g.zero_grad()
      out_d3 = self.compute_forward_d(out_g2, clean_wavs)
      loss_g3 = self.compute_objectives_g3(
          out_d3,
          out_g2,
          clean_wavs,
          batch,
          sb.Stage.TRAIN,
          z_mean=z_mean,
          z_logvar=z_logvar,
      )
      loss_g3.backward()
      torch.nn.utils.clip_grad_norm_(
          self.modules.parameters(), self.max_grad_norm
      )
      self.optimizer_g.step()
      self.optimizer_g.zero_grad()
      self.optimizer_d.zero_grad()
  
      loss_d1.detach().cpu()
      loss_d2.detach().cpu()
      loss_g3.detach().cpu()
  
      return loss_d1 + loss_d2 + loss_g3
  
imports: import os
  import sys
  import torch
  import torchaudio
  import speechbrain
  from pesq import pesq
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.metric_stats import MetricStats
  from speechbrain.nnet.loss.stoi_loss import stoi_loss
  from speechbrain.utils.distributed import run_on_main
label_desc: Use image node_id 6 for calling the SEBrain obj's underlying member method code with example usage: obj.fit_batch(batch) and returns: unknown