class_docstr: Link prediction network for graphs / knowledge graphs
class_docstr_tok: ["Link","prediction","network","for","graphs","\/","knowledge","graphs"]
code: def __init__(self, score_function, *embeddings, **kwargs):
      super(LinkPredictor, self).__init__()
      if isinstance(score_function, types.FunctionType):
          self.score_function = score_function
      else:
          self.score_function = getattr(LinkPredictor, score_function)
      self.kwargs = kwargs
      self.embeddings = nn.ModuleList()
      for embedding in embeddings:
          embedding = torch.as_tensor(embedding)
          embedding = nn.Embedding.from_pretrained(
              embedding, freeze=True
          )
          self.embeddings.append(embedding)
  
file_path: graphvite/python/graphvite/application/network.py
imports: from __future__ import absolute_import
  import types
  import numpy
  import torch
  from torch import nn
label_desc: Use image node_id 1 to create a new LinkPredictor object from inherited base classes: nn with example: obj = LinkPredictor(score_function)