class_docstr: Abstract Knowledge Graph embedding model class.
  
  Module to define basic operations in KG embedding models, including embedding
  initialization, computing embeddings and triples' scores.
class_docstr_tok: ["Abstract","Knowledge","Graph","embedding","model","class",".","Module","to","define","basic","operations","in","KG","embedding","models",",","including","embedding","initialization",",","computing","embeddings","and","triples","'","scores","."]
docstr: Forward pass of KG embedding models.
  
  Args:
    input_tensor: Tensor of size batch_size x 3 containing triples' indices.
    eval_mode: boolean to indicate whether to compute scores against all
      possible tail entities in the KG, or only individual triples' scores.
  
  Returns:
    Tensor containing triple scores. If eval_mode is False, this tensor
    has size batch_size x 1, otherwise it has size batch_size x n_entities
    where n_entities is the total number of entities in the KG.
docstr_tok: ["Forward","pass","of","KG","embedding","models",".","Args",":","input_tensor",":","Tensor","of","size","batch_size","x","3","containing","triples","'","indices",".","eval_mode",":","boolean","to","indicate","whether","to","compute","scores","against","all","possible","tail","entities","in","the","KG",",","or","only","individual","triples","'","scores",".","Returns",":","Tensor","containing","triple","scores",".","If","eval_mode","is","False",",","this","tensor","has","size","batch_size","x","1",",","otherwise","it","has","size","batch_size","x","n_entities","where","n_entities","is","the","total","number","of","entities","in","the","KG","."]
code: def call(self, input_tensor, eval_mode=False):
      """Forward pass of KG embedding models.
  
      Args:
        input_tensor: Tensor of size batch_size x 3 containing triples' indices.
        eval_mode: boolean to indicate whether to compute scores against all
          possible tail entities in the KG, or only individual triples' scores.
  
      Returns:
        Tensor containing triple scores. If eval_mode is False, this tensor
        has size batch_size x 1, otherwise it has size batch_size x n_entities
        where n_entities is the total number of entities in the KG.
      """
      lhs = self.get_queries(input_tensor)
      lhs_biases = self.bh(input_tensor[:, 0])
      if eval_mode:
          rhs = self.get_candidates()
          rhs_biases = self.bt.embeddings
      else:
          rhs = self.get_rhs(input_tensor)
          rhs_biases = self.bt(input_tensor[:, 2])
      predictions = self.score(
          lhs, lhs_biases, rhs, rhs_biases, eval_mode
      )
      return predictions
  
file_path: neural-structured-learning/research/kg_hyp_emb/models/base.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  from kg_hyp_emb.learning import regularizers
  import numpy
  import tensorflow
label_desc: Use image node_id 6 for calling the KGModel obj's underlying member method code with example usage: obj.call(input_tensor, eval_mode) and returns: predictions