docstr: Determines whether or not the CTC loss should be enabled.
  It is enabled only if a ctc_lin module has been defined in
  the hyperparameter file, only during training and only for
  the number of epochs determined by the ctc_epochs hyperparameter
  of the corresponding training step.
  
  Arguments
  ---------
  stage: speechbrain.Stage
      the training stage
docstr_tok: ["Determines","whether","or","not","the","CTC","loss","should","be","enabled",".","It","is","enabled","only","if","a","ctc_lin","module","has","been","defined","in","the","hyperparameter","file",",","only","during","training","and","only","for","the","number","of","epochs","determined","by","the","ctc_epochs","hyperparameter","of","the","corresponding","training","step",".","Arguments","--","--","--","--","-","stage",":","speechbrain.Stage","the","training","stage"]
code: def is_ctc_active(self, stage):
      """Determines whether or not the CTC loss should be enabled.
      It is enabled only if a ctc_lin module has been defined in
      the hyperparameter file, only during training and only for
      the number of epochs determined by the ctc_epochs hyperparameter
      of the corresponding training step.
  
      Arguments
      ---------
      stage: speechbrain.Stage
          the training stage
      """
      if stage != sb.Stage.TRAIN:
          return False
      current_epoch = self.epoch_counter.current
      return current_epoch <= self.train_step["ctc_epochs"]
  
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 9 for calling the G2PBrain obj's underlying member method code with example usage: obj.is_ctc_active(stage) and returns: unknown, False