code: def on_validation_epoch_end(self):
      loss_outputs = self.validation_step_outputs[0]["loss_outputs"]
  
      for k, v in loss_outputs.items():
          if k != "binarization_loss":
              self.log(
                  "val/" + k,
                  loss_outputs[k][0],
                  sync_dist=True,
                  on_epoch=True,
              )
  
      attn = self.validation_step_outputs[0]["attn"]
      attn_soft = self.validation_step_outputs[0]["attn_soft"]
  
      self.tb_logger.add_image(
          "attention_weights_mas",
          plot_alignment_to_numpy(
              attn[0, 0].data.cpu().numpy().T, title="audio"
          ),
          self.global_step,
          dataformats="HWC",
      )
  
      self.tb_logger.add_image(
          "attention_weights",
          plot_alignment_to_numpy(
              attn_soft[0, 0].data.cpu().numpy().T, title="audio"
          ),
          self.global_step,
          dataformats="HWC",
      )
      self.log_train_images = True
      self.validation_step_outputs.clear()
  
imports: import contextlib
  import torch
  from hydra.utils import instantiate
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import Trainer
  from pytorch_lightning.loggers import TensorBoardLogger
  from nemo.collections.common.tokenizers.text_to_speech.tts_tokenizers import BaseTokenizer
  from nemo.collections.tts.losses.radttsloss import AttentionBinarizationLoss, RADTTSLoss
  from nemo.collections.tts.models.base import SpectrogramGenerator
  from nemo.collections.tts.parts.utils.helpers import batch_from_ragged, g2p_backward_compatible_support, plot_alignment_to_numpy, regulate_len, sample_tts_input
  from nemo.core.classes import Exportable
  from nemo.core.classes.common import typecheck
  from nemo.core.neural_types.elements import Index, MelSpectrogramType, RegressionValuesType, TokenDurationType, TokenIndex
  from nemo.core.neural_types.neural_type import NeuralType
  from nemo.core.optim.radam import RAdam
  from nemo.utils import logging
  from nemo.utils.decorators import experimental
label_desc: Use image node_id 5 for calling the RadTTSModel obj's underlying member method code with example usage: obj.on_validation_epoch_end() without return types