class_docstr: Base model class for complex embeddings.
class_docstr_tok: ["Base","model","class","for","complex","embeddings","."]
code: def similarity_score(self, lhs, rhs, eval_mode):
      lhs = lhs[:, : self.half_rank], lhs[:, self.half_rank :]
      rhs = rhs[:, : self.half_rank], rhs[:, self.half_rank :]
      if eval_mode:
          return tf.matmul(lhs[0], tf.transpose(rhs[0])) + tf.matmul(
              lhs[1], tf.transpose(rhs[1])
          )
      else:
          return tf.reduce_sum(
              lhs[0] * rhs[0] + lhs[1] * rhs[1], axis=-1, keepdims=True
          )
  
file_path: neural-structured-learning/research/kg_hyp_emb/models/complex.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from kg_hyp_emb.models.base import KGModel
  import tensorflow
label_desc: Use image node_id 4 for calling the BaseC obj's underlying member method code with example usage: obj.similarity_score(lhs, rhs, eval_mode) and returns: unknown, tf