class_docstr: Complex Embeddings for Simple Link Prediction.
  https://arxiv.org/abs/1606.06357
class_docstr_tok: ["Complex","Embeddings","for","Simple","Link","Prediction",".","https",":","\/\/arxiv.org\/abs\/1606.06357"]
code: def get_neg_score(self, head, rel, tail, neg_head=False):
      if neg_head:
          re_tail, im_tail = paddle.chunk(tail, chunks=2, axis=-1)
          re_rel, im_rel = paddle.chunk(rel, chunks=2, axis=-1)
          re_emb = re_tail * re_rel + im_tail * im_rel
          im_emb = im_tail * re_rel - re_tail * im_rel
          complex_emb = paddle.concat([re_emb, im_emb], axis=-1)
          complex_emb = paddle.reshape(complex_emb, tail.shape)
          score = paddle.bmm(complex_emb, head.transpose([0, 2, 1]))
          return score
      else:
          re_head, im_head = paddle.chunk(head, chunks=2, axis=-1)
          re_rel, im_rel = paddle.chunk(rel, chunks=2, axis=-1)
          re_emb = re_head * re_rel - im_head * im_rel
          im_emb = re_head * im_rel + im_head * re_rel
          complex_emb = paddle.concat([re_emb, im_emb], axis=-1)
          complex_emb = paddle.reshape(complex_emb, head.shape)
          score = paddle.bmm(complex_emb, tail.transpose([0, 2, 1]))
          return 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 3 for calling the ComplExScore obj's underlying member method code with example usage: obj.get_neg_score(head, rel, tail, neg_head) and returns: score, score