class_docstr: Complex Embeddings (ComplEx) scoring layer.
  
  The ComplEx model :cite:`trouillon2016complex` is an extension of
  the :class:`ampligraph.latent_features.DistMult` bilinear diagonal model.
  
  ComplEx scoring function is based on the trilinear Hermitian dot product in :math:`\mathbb{C}`:
  
  .. math::
      f_{ComplEx}=Re(\langle \mathbf{r}_p, \mathbf{e}_s, \overline{\mathbf{e}_o}  \rangle)
  
  .. note::
      Since ComplEx embeddings belong to :math:`\mathbb{C}`, this model uses twice as many parameters as
      :class:`ampligraph.latent_features.DistMult`.
docstr: Compute subject corruption scores.
  
  Evaluate the inputs against subject corruptions and scores of the corruptions.
  
  Parameters
  ----------
  triples: array-like, shape (n, k)
      Batch of input embeddings.
  ent_matrix: array-like, shape (m, k)
      Slice of embedding matrix (corruptions).
  
  Returns
  -------
  scores: tf.Tensor, shape (n, 1)
      Scores of subject corruptions (corruptions defined by `ent_embs` matrix).
code: def _get_subject_corruption_scores(self, triples, ent_matrix):
      """Compute subject corruption scores.
  
      Evaluate the inputs against subject corruptions and scores of the corruptions.
  
      Parameters
      ----------
      triples: array-like, shape (n, k)
          Batch of input embeddings.
      ent_matrix: array-like, shape (m, k)
          Slice of embedding matrix (corruptions).
  
      Returns
      -------
      scores: tf.Tensor, shape (n, 1)
          Scores of subject corruptions (corruptions defined by `ent_embs` matrix).
      """
      # split the embeddings of s, p, o into 2 parts (real and img part)
      e_s_real, e_s_img = tf.split(triples[0], 2, axis=1)
      e_p_real, e_p_img = tf.split(triples[1], 2, axis=1)
      e_o_real, e_o_img = tf.split(triples[2], 2, axis=1)
  
      # split the corruption entity embeddings into 2 parts (real and img
      # part)
      ent_real, ent_img = tf.split(ent_matrix, 2, axis=1)
  
      # compute the subject corruption score using ent_real, ent_img
      # (corruption embeddings) as subject embeddings
      sub_corr_score = tf.reduce_sum(
          ent_real
          * (
              tf.expand_dims(e_p_real * e_o_real, 1)
              + tf.expand_dims(e_p_img * e_o_img, 1)
          )
          + (
              ent_img
              * (
                  tf.expand_dims(e_p_real * e_o_img, 1)
                  - tf.expand_dims(e_p_img * e_o_real, 1)
              )
          ),
          axis=2,
      )
      return sub_corr_score
  
file_path: AmpliGraph/ampligraph/latent_features/layers/scoring/ComplEx.py
imports: import tensorflow
  from .AbstractScoringLayer import register_layer, AbstractScoringLayer
label_desc: Use image node_id 4 for calling the ComplEx obj's underlying member method code with example usage: obj._get_subject_corruption_scores(triples, ent_matrix) and returns: sub_corr_score