class_docstr: Base class for encoder decoder CTC-based models.
class_docstr_tok: ["Base","class","for","encoder","decoder","CTC-based","models","."]
code: def training_step(self, batch, batch_nb):
      # Reset access registry
      if AccessMixin.is_access_enabled():
          AccessMixin.reset_registry(self)
  
      if self.is_interctc_enabled():
          AccessMixin.set_access_enabled(access_enabled=True)
  
      video_signal, video_signal_len, transcript, transcript_len = batch
      log_probs, encoded_len, predictions = self.forward(
          input_video_signal=video_signal,
          input_video_signal_length=video_signal_len,
      )
  
      if hasattr(self, "_trainer") and self._trainer is not None:
          log_every_n_steps = self._trainer.log_every_n_steps
      else:
          log_every_n_steps = 1
  
      loss_value = self.loss(
          log_probs=log_probs,
          targets=transcript,
          input_lengths=encoded_len,
          target_lengths=transcript_len,
      )
  
      # Add auxiliary losses, if registered
      loss_value = self.add_auxiliary_losses(loss_value)
      # only computing WER when requested in the logs (same as done for final-layer WER below)
      loss_value, tensorboard_logs = self.add_interctc_losses(
          loss_value,
          transcript,
          transcript_len,
          compute_wer=((batch_nb + 1) % log_every_n_steps == 0),
      )
  
      # Reset access registry
      if AccessMixin.is_access_enabled():
          AccessMixin.reset_registry(self)
  
      tensorboard_logs.update(
          {
              "train_loss": loss_value,
              "learning_rate": self._optimizer.param_groups[0]["lr"],
              "global_step": torch.tensor(
                  self.trainer.global_step, dtype=torch.float32
              ),
          }
      )
  
      if (batch_nb + 1) % log_every_n_steps == 0:
          self.wer.update(
              predictions=log_probs,
              targets=transcript,
              target_lengths=transcript_len,
              predictions_lengths=encoded_len,
          )
          wer, _, _ = self.wer.compute()
          self.wer.reset()
          tensorboard_logs.update({"training_batch_wer": wer})
  
      return {"loss": loss_value, "log": tensorboard_logs}
  
imports: import copy
  import json
  import os
  import tempfile
  from math import ceil
  from typing import Dict, List, Optional, 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.losses.ctc import CTCLoss
  from nemo.collections.asr.metrics.wer import WER
  from nemo.collections.asr.models.asr_model import ASRModel, ExportableEncDecModel
  from nemo.collections.asr.parts.mixins import ASRModuleMixin, InterCTCMixin
  from nemo.collections.asr.parts.submodules.ctc_decoding import CTCDecoding, CTCDecodingConfig
  from nemo.collections.asr.parts.utils.audio_utils import ChannelSelectorType
  from nemo.collections.multimodal.speech_cv.data import video_to_text_dataset
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.classes.mixins import AccessMixin
  from nemo.core.neural_types import LabelsType, LengthsType, LogprobsType, NeuralType, VideoSignal
  from nemo.utils import logging
label_desc: Use image node_id 12 for calling the VisualEncDecCTCModel obj's underlying member method code with example usage: obj.training_step(batch, batch_nb) and returns: dict