class_docstr: Base class for encoder-decoder models used for self-supervised encoder pre-training
class_docstr_tok: ["Base","class","for","encoder-decoder","models","used","for","self-supervised","encoder","pre-training"]
code: def validation_pass(self, batch, batch_idx, dataloader_idx=0):
      # Set flag to register tensors
      self._in_validation_step = True
  
      signal, signal_len, targets, target_lengths = batch
      if isinstance(batch, DALIOutputs) and batch.has_processed_signal:
          spectrograms, spec_masks, encoded, encoded_len = self.forward(
              processed_signal=signal,
              processed_signal_length=signal_len,
          )
      else:
          spectrograms, spec_masks, encoded, encoded_len = self.forward(
              input_signal=signal,
              input_signal_length=signal_len,
          )
  
      if self.decoder_losses is not None:
          for dec_loss_name, dec_loss in self.decoder_losses.items():
              self.decoder_losses_active[dec_loss_name] = (
                  self.trainer.global_step
                  >= self.start_step[dec_loss_name]
              )
  
      loss_value, _ = self.decoder_loss_step(
          spectrograms,
          spec_masks,
          encoded,
          encoded_len,
          targets,
          target_lengths,
      )
  
      if self.feat_pen:
          loss_value += self.feat_pen
  
      # reset access registry
      self.reset_registry()
      del self._in_validation_step
  
      metrics = {"val_loss": loss_value}
  
      return metrics
  
imports: from math import ceil
  from typing import Dict, List, Optional, Union
  import torch
  import torch.nn
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from nemo.collections.asr.data import audio_to_text_dataset
  from nemo.collections.asr.data.audio_to_text_dali import DALIOutputs
  from nemo.collections.asr.data.audio_to_text_lhotse import LhotseSpeechToTextBpeDataset
  from nemo.collections.asr.parts.mixins import ASRModuleMixin
  from nemo.collections.asr.parts.preprocessing.perturb import process_augmentations
  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 import ModelPT
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.classes.mixins import AccessMixin, set_access_cfg
  from nemo.core.neural_types import AcousticEncodedRepresentation, AudioSignal, LabelsType, LengthsType, NeuralType, SpectrogramType
  from nemo.utils import logging
label_desc: Use image node_id 11 for calling the SpeechEncDecSelfSupervisedModel obj's underlying member method code with example usage: obj.validation_pass(batch, batch_idx, dataloader_idx) and returns: metrics