docstr: Called at the end of validation to aggregate outputs.
  :param outputs: list of individual outputs of each validation step.
docstr_tok: ["Called","at","the","end","of","validation","to","aggregate","outputs",".",":","param","outputs",":","list","of","individual","outputs","of","each","validation","step","."]
code: def on_validation_epoch_end(self):
      """
      Called at the end of validation to aggregate outputs.
      :param outputs: list of individual outputs of each validation step.
      """
  
      prefix = "test" if self.trainer.testing else "val"
      if prefix == "val":
          outputs = self.validation_step_outputs
      else:
          outputs = self.test_step_outputs
      (
          unified_slot_precision,
          unified_slot_recall,
          unified_slot_f1,
          unified_slot_joint_goal_accuracy,
      ) = self.get_unified_metrics(outputs)
  
      avg_loss = torch.stack([x["val_loss"] for x in outputs]).mean()
  
      # calculate metrics and log classification report (separately for intents and slots)
      (
          intent_precision,
          intent_recall,
          intent_f1,
          intent_report,
      ) = self.intent_classification_report.compute()
      logging.info(f"Intent report: {intent_report}")
  
      (
          slot_precision,
          slot_recall,
          slot_f1,
          slot_report,
      ) = self.slot_classification_report.compute()
      logging.info(f"Slot report: {slot_report}")
  
      self.log(f"{prefix}_loss", avg_loss)
      self.log("intent_precision", intent_precision)
      self.log("intent_recall", intent_recall)
      self.log("intent_f1", intent_f1)
      self.log("slot_precision", slot_precision)
      self.log("slot_recall", slot_recall)
      self.log("slot_f1", slot_f1)
      self.log("unified_slot_precision", unified_slot_precision)
      self.log("unified_slot_recall", unified_slot_recall)
      self.log("unified_slot_f1", unified_slot_f1)
      self.log(
          "unified_slot_joint_goal_accuracy",
          unified_slot_joint_goal_accuracy,
      )
  
      self.intent_classification_report.reset()
      self.slot_classification_report.reset()
  
      self.validation_step_outputs.clear() if prefix == "val" else self.test_step_outputs.clear()
      return {
          "val_loss": avg_loss,
          "intent_precision": intent_precision,
          "intent_recall": intent_recall,
          "intent_f1": intent_f1,
          "slot_precision": slot_precision,
          "slot_recall": slot_recall,
          "slot_f1": slot_f1,
          "unified_slot_precision": unified_slot_precision,
          "unified_slot_recall": unified_slot_recall,
          "unified_slot_f1": unified_slot_f1,
          "unified_slot_joint_goal_accuracy": unified_slot_joint_goal_accuracy,
      }
  
imports: import os
  from typing import Dict, List, Optional
  import torch
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import Trainer
  from torch.utils.data import DataLoader
  from nemo.collections.common.losses import AggregatorLoss, CrossEntropyLoss
  from nemo.collections.nlp.data.dialogue.data_processor.assistant_data_processor import DialogueAssistantDataProcessor
  from nemo.collections.nlp.data.dialogue.dataset.dialogue_bert_dataset import DialogueBERTDataset, DialogueIntentSlotInferenceDataset
  from nemo.collections.nlp.data.intent_slot_classification import IntentSlotDataDesc
  from nemo.collections.nlp.metrics.classification_report import ClassificationReport
  from nemo.collections.nlp.metrics.dialogue_metrics import DialogueClassificationMetrics
  from nemo.collections.nlp.models.nlp_model import NLPModel
  from nemo.collections.nlp.modules.common import SequenceTokenClassifier
  from nemo.collections.nlp.parts.utils_funcs import tensor2list
  from nemo.core.classes import typecheck
  from nemo.core.classes.common import PretrainedModelInfo
  from nemo.utils import logging
label_desc: Use image node_id 14 for calling the IntentSlotClassificationModel obj's underlying member method code with example usage: obj.on_validation_epoch_end() and returns: dict