class_docstr: RotatE model.
class_docstr_tok: ["RotatE","model","."]
docstr: the score function for validation
docstr_tok: ["the","score","function","for","validation"]
code: def score_with_l2_normalize_with_validate(
      self, entity_embedding, head, rel, tail, epsilon_var
  ):
      """
      the score function for validation
      """
      re_entity_embedding, im_entity_embedding = fluid.layers.split(
          entity_embedding, num_or_sections=2, dim=-1
      )
      re_head, im_head = fluid.layers.split(
          head, num_or_sections=2, dim=-1
      )
      re_tail, im_tail = fluid.layers.split(
          tail, num_or_sections=2, dim=-1
      )
      phase_relation = rel / (
          self._relation_embedding_margin / self._pi
      )
      re_relation = fluid.layers.cos(phase_relation)
      im_relation = fluid.layers.sin(phase_relation)
  
      re_score = re_relation * re_tail + im_relation * im_tail
      im_score = re_relation * im_tail - im_relation * re_tail
      re_score = re_entity_embedding - re_score
      im_score = im_entity_embedding - im_score
  
      re_score = re_score * re_score
      im_score = im_score * im_score
      head_score = re_score + im_score
      head_score += epsilon_var
      head_score = fluid.layers.sqrt(head_score)
      head_score = fluid.layers.reduce_sum(head_score, dim=-1)
  
      re_score = re_head * re_relation - im_head * im_relation
      im_score = re_head * im_relation + im_head * re_relation
      re_score = re_entity_embedding - re_score
      im_score = im_entity_embedding - im_score
  
      re_score = re_score * re_score
      im_score = im_score * im_score
      tail_score = re_score + im_score
      tail_score += epsilon_var
      tail_score = fluid.layers.sqrt(tail_score)
      tail_score = fluid.layers.reduce_sum(tail_score, dim=-1)
  
      return head_score, tail_score
  
file_path: PGL/legacy/examples/pgl-ke/model/RotatE.py
imports: import paddle.fluid
  from .Model import Model
  from .utils import lookup_table
label_desc: Use image node_id 7 for calling the RotatE obj's underlying member method code with example usage: obj.score_with_l2_normalize_with_validate(entity_embedding, head, rel, tail, epsilon_var) and returns: head_score,  tail_score