class_docstr: Build GripNet-DistMult (encoder-decoder) model for link prediction.
  
  Args:
      supergraph (SuperGraph): the input supergraph.
      learning_rate (float): the learning rate for training.
      epsilon (float, optional): a small number in loss function to improve numerical stability. Defaults to 1e-13.
code: def forward(
      self,
      edge_index: torch.Tensor,
      edge_type: torch.Tensor,
      edge_type_range: torch.Tensor,
  ) -> Tuple:
      x = self.encoder()
  
      pos_score = self.decoder(x, edge_index, edge_type)
      pos_loss = -torch.log(pos_score + self.epsilon).mean()
  
      edge_index = typed_negative_sampling(
          edge_index, self.num_task_nodes, edge_type_range
      )
  
      neg_score = self.decoder(x, edge_index, edge_type)
      neg_loss = -torch.log(1 - neg_score + self.epsilon).mean()
  
      loss = pos_loss + neg_loss
  
      # compute averaged metric scores over edge types
      num_edge_type = edge_type_range.shape[0]
      record = []
      for i in range(num_edge_type):
          start, end = edge_type_range[i]
          pos_score_this_type, neg_score_this_type = (
              pos_score[start:end],
              neg_score[start:end],
          )
  
          score = torch.cat([pos_score_this_type, neg_score_this_type])
          target = torch.cat(
              [
                  torch.ones(pos_score_this_type.shape[0]),
                  torch.zeros(neg_score_this_type.shape[0]),
              ]
          )
  
          record.append(list(auprc_auroc_ap(target, score)))
      auprc, auroc, ave_precision = np.array(record).mean(axis=0)
  
      return loss, auprc, auroc, ave_precision
  
imports: from typing import List, Tuple
  import numpy
  import pytorch_lightning
  import torch
  import torch.nn
  import torch.nn.functional
  from kale.embed.gripnet import GripNet
  from kale.evaluate.metrics import auprc_auroc_ap
  from kale.prepdata.graph_negative_sampling import typed_negative_sampling
  from kale.prepdata.supergraph_construct import SuperGraph
  from kale.utils.initialize_nn import bias_init, xavier_init
label_desc: Use image node_id 3 for calling the GripNetLinkPrediction obj's underlying member method code with example usage: obj.forward(edge_index, edge_type, edge_type_range) and returns: loss,  auprc,  auroc,  ave_precision