docstr: Gets called at the beginning of each epoch
docstr_tok: ["Gets","called","at","the","beginning","of","each","epoch"]
code: def on_stage_start(self, stage, epoch):
      """Gets called at the beginning of each epoch"""
      self.seq_metrics = self.hparams.seq_stats()
  
      if self.start_epoch is None:
          self.start_epoch = epoch
  
      if self.hparams.enable_metrics:
          if stage != sb.Stage.TRAIN:
              self.per_metrics = self.hparams.per_stats()
  
          if self.mode == TrainMode.HOMOGRAPH:
              self.seq_metrics_homograph = (
                  self.hparams.seq_stats_homograph()
              )
              self.classification_metrics_homograph = (
                  self.hparams.classification_stats_homograph()
              )
  
              if stage != sb.Stage.TRAIN:
                  self.per_metrics_homograph = (
                      self.hparams.per_stats_homograph()
                  )
  
      if self.mode == TrainMode.HOMOGRAPH:
          self._set_word_separator()
      self.grapheme_word_separator_idx = (
          self.hparams.grapheme_encoder.lab2ind[" "]
      )
      if self.hparams.use_word_emb:
          self.modules.word_emb = self.hparams.word_emb().to(
              self.device
          )
  
imports: from speechbrain.dataio.dataset import FilteredSortedDynamicItemDataset, DynamicItemDataset
  from speechbrain.dataio.sampler import BalancingDataSampler
  from speechbrain.utils.data_utils import undo_padding
  import datasets
  import logging
  import os
  import random
  import speechbrain
  import sys
  from enum import Enum
  from collections import namedtuple
  from hyperpyyaml import load_hyperpyyaml
  from functools import partial
  from speechbrain.utils.distributed import run_on_main
  from speechbrain.utils.pretrained import save_for_pretrained
  from speechbrain.lobes.models.g2p.dataio import enable_eos_bos, grapheme_pipeline, phoneme_pipeline, tokenizer_encode_pipeline, add_bos_eos, get_sequence_key, phonemes_to_label
  from speechbrain.dataio.wer import print_alignments
  from speechbrain.wordemb.util import expand_to_chars
  from io import StringIO
  from speechbrain.utils import hpopt
  import numpy
label_desc: Use image node_id 10 for calling the G2PBrain obj's underlying member method code with example usage: obj.on_stage_start(stage, epoch) without return types