class_docstr: Second stage pretraining of BERT based language model
  for entity linking task. An implementation of Liu et. al's
  NAACL 2021 paper Self-Alignment Pretraining for Biomedical Entity Representations.
class_docstr_tok: ["Second","stage","pretraining","of","BERT","based","language","model","for","entity","linking","task",".","An","implementation","of","Liu","et",".","al's","NAACL","2021","paper","Self-Alignment","Pretraining","for","Biomedical","Entity","Representations","."]
docstr: Called at the end of validation to aggregate outputs.
  
  Args:
      outputs: list of individual outputs of each validation step.
  Returns:
      
docstr_tok: ["Called","at","the","end","of","validation","to","aggregate","outputs",".","Args",":","outputs",":","list","of","individual","outputs","of","each","validation","step",".","Returns",":"]
code: def on_validation_epoch_end(self):
      """
      Called at the end of validation to aggregate outputs.
  
      Args:
          outputs: list of individual outputs of each validation step.
      Returns:
  
      """
      if self.validation_step_outputs:
          avg_loss = torch.stack(
              [
                  x["val_loss"]
                  for x in self.validation_step_outputs
                  if x["val_loss"] != None
              ]
          ).mean()
          self.log(f"val_loss", avg_loss, prog_bar=True)
          self.validation_step_outputs.clear()  # free memory
          return {"val_loss": avg_loss}
  
imports: from typing import Dict, Optional
  import torch
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from transformers import AutoTokenizer
  from nemo.collections.common.losses import MultiSimilarityLoss
  from nemo.collections.nlp.data import EntityLinkingDataset
  from nemo.collections.nlp.models.nlp_model import NLPModel
  from nemo.core.classes.common import typecheck
  from nemo.core.classes.exportable import Exportable
  from nemo.core.neural_types import LogitsType, NeuralType
  from nemo.utils import logging
label_desc: Use image node_id 7 for calling the EntityLinkingModel obj's underlying member method code with example usage: obj.on_validation_epoch_end() and returns: dict