class_docstr: Base class for encoder decoder RNNT-based models.
class_docstr_tok: ["Base","class","for","encoder","decoder","RNNT-based","models","."]
docstr: Helper method to setup normalization of certain parts of the model prior to the optimization step.
  
  Supported pre-optimization normalizations are as follows:
  
  .. code-block:: yaml
  
      # Variation Noise injection
      model:
          variational_noise:
              std: 0.0
              start_step: 0
  
      # Joint - Length normalization
      model:
          normalize_joint_txu: false
  
      # Encoder Network - gradient normalization
      model:
          normalize_encoder_norm: false
  
      # Decoder / Prediction Network - gradient normalization
      model:
          normalize_decoder_norm: false
  
      # Joint - gradient normalization
      model:
          normalize_joint_norm: false
docstr_tok: ["Helper","method","to","setup","normalization","of","certain","parts","of","the","model","prior","to","the","optimization","step",".","Supported","pre-optimization","normalizations","are","as","follows",":","..","code-block",":",":","yaml","#","Variation","Noise","injection","model",":","variational_noise",":","std",":","0.0","start_step",":","0","#","Joint","-","Length","normalization","model",":","normalize_joint_txu",":","false","#","Encoder","Network","-","gradient","normalization","model",":","normalize_encoder_norm",":","false","#","Decoder","\/","Prediction","Network","-","gradient","normalization","model",":","normalize_decoder_norm",":","false","#","Joint","-","gradient","normalization","model",":","normalize_joint_norm",":","false"]
code: def setup_optim_normalization(self):
      """
      Helper method to setup normalization of certain parts of the model prior to the optimization step.
  
      Supported pre-optimization normalizations are as follows:
  
      .. code-block:: yaml
  
          # Variation Noise injection
          model:
              variational_noise:
                  std: 0.0
                  start_step: 0
  
          # Joint - Length normalization
          model:
              normalize_joint_txu: false
  
          # Encoder Network - gradient normalization
          model:
              normalize_encoder_norm: false
  
          # Decoder / Prediction Network - gradient normalization
          model:
              normalize_decoder_norm: false
  
          # Joint - gradient normalization
          model:
              normalize_joint_norm: false
      """
      # setting up the variational noise for the decoder
      if hasattr(self.cfg, "variational_noise"):
          self._optim_variational_noise_std = self.cfg[
              "variational_noise"
          ].get("std", 0)
          self._optim_variational_noise_start = self.cfg[
              "variational_noise"
          ].get("start_step", 0)
      else:
          self._optim_variational_noise_std = 0
          self._optim_variational_noise_start = 0
  
      # Setup normalized gradients for model joint by T x U scaling factor (joint length normalization)
      self._optim_normalize_joint_txu = self.cfg.get(
          "normalize_joint_txu", False
      )
      self._optim_normalize_txu = None
  
      # Setup normalized encoder norm for model
      self._optim_normalize_encoder_norm = self.cfg.get(
          "normalize_encoder_norm", False
      )
  
      # Setup normalized decoder norm for model
      self._optim_normalize_decoder_norm = self.cfg.get(
          "normalize_decoder_norm", False
      )
  
      # Setup normalized joint norm for model
      self._optim_normalize_joint_norm = self.cfg.get(
          "normalize_joint_norm", False
      )
  
imports: import copy
  import json
  import os
  import tempfile
  from math import ceil
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from omegaconf import DictConfig, OmegaConf, open_dict
  from pytorch_lightning import Trainer
  from tqdm.auto import tqdm
  from nemo.collections.asr.data import audio_to_text_dataset
  from nemo.collections.asr.data.audio_to_text_dali import AudioToCharDALIDataset, DALIOutputs
  from nemo.collections.asr.data.audio_to_text_lhotse import LhotseSpeechToTextBpeDataset
  from nemo.collections.asr.losses.rnnt import RNNTLoss, resolve_rnnt_default_loss_name
  from nemo.collections.asr.metrics.wer import WER
  from nemo.collections.asr.models.asr_model import ASRModel, ExportableEncDecModel
  from nemo.collections.asr.modules.rnnt import RNNTDecoderJoint
  from nemo.collections.asr.parts.mixins import ASRModuleMixin
  from nemo.collections.asr.parts.submodules.rnnt_decoding import RNNTDecoding, RNNTDecodingConfig
  from nemo.collections.asr.parts.utils.audio_utils import ChannelSelectorType
  from nemo.collections.common.data.lhotse import get_lhotse_dataloader_from_config
  from nemo.collections.common.parts.preprocessing.parsers import make_parser
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.classes.mixins import AccessMixin
  from nemo.core.neural_types import AcousticEncodedRepresentation, AudioSignal, LengthsType, NeuralType, SpectrogramType
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling the EncDecRNNTModel obj's underlying member method code with example usage: obj.setup_optim_normalization() without return types