class_docstr: Orthogonal Relation Transforms with Graph Context Modeling for Knowledge Graph Embedding.
  https://aclanthology.org/2020.acl-main.241/
class_docstr_tok: ["Orthogonal","Relation","Transforms","with","Graph","Context","Modeling","for","Knowledge","Graph","Embedding",".","https",":","\/\/aclanthology.org\/2020.acl-main.241\/"]
code: def __call__(self, head, rel, tail):
      rel = self.orth_rel_embedding(rel)
  
      assert head.shape[:-1] == rel.shape[:-1]
      shape = head.shape
      head = head.reshape([-1, 1, self.num_elem])
      if self.use_scale:
          rel = rel.reshape([-1, self.num_elem, self.num_elem + 1])
          scale = self.get_scale(rel[:, :, self.num_elem :])
          scale = scale / scale.norm(axis=-1, p=2, keepdim=True)
          rel = rel[:, :, : self.num_elem] * scale
      else:
          rel = rel.reshape([-1, self.num_elem, self.num_elem])
      output = paddle.bmm(head, rel).reshape(shape)
      score = self._get_score(output, tail)
      return self.gamma - score
  
imports: import math
  import numpy
  from numpy.random import RandomState
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.functional import log_sigmoid
label_desc: Use image node_id 6 for calling the OTEScore obj's underlying member method code with example usage: obj.__call__(head, rel, tail) and returns: unknown