docstr: Gets called at the beginning of each epoch
  
  This method calls ``fit()`` again to train the discriminator
  before proceeding with generator training.
docstr_tok: ["Gets","called","at","the","beginning","of","each","epoch","This","method","calls","``","fit","(",")","``","again","to","train","the","discriminator","before","proceeding","with","generator","training","."]
code: def on_stage_start(self, stage, epoch=None):
      """Gets called at the beginning of each epoch
  
      This method calls ``fit()`` again to train the discriminator
      before proceeding with generator training.
      """
  
      self.mse_metric = MetricStats(metric=self.hparams.compute_cost)
      self.metrics = {"G": [], "D": []}
  
      if stage == sb.Stage.TRAIN:
          if self.hparams.target_metric == "pesq":
              self.target_metric = MetricStats(
                  metric=pesq_eval,
                  n_jobs=hparams["n_jobs"],
                  batch_eval=False,
              )
          elif self.hparams.target_metric == "stoi":
              self.target_metric = MetricStats(metric=stoi_loss)
          else:
              raise NotImplementedError(
                  "Right now we only support 'pesq' and 'stoi'"
              )
  
          # Train discriminator before we start generator training
          if self.sub_stage == SubStage.GENERATOR:
              self.epoch = epoch
              self.train_discriminator()
              self.sub_stage = SubStage.GENERATOR
              print("Generator training by current data...")
  
      if stage != sb.Stage.TRAIN:
          self.pesq_metric = MetricStats(
              metric=pesq_eval,
              n_jobs=hparams["n_jobs"],
              batch_eval=False,
          )
          self.stoi_metric = MetricStats(metric=stoi_loss)
  
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 11 for calling the MetricGanBrain obj's underlying member method code with example usage: obj.on_stage_start(stage, epoch) without return types