class_docstr: DistMult scoring layer.
  
  The model as described in :cite:`yang2014embedding`.
  
  The bilinear diagonal DistMult model uses the trilinear dot product as scoring function:
  
  .. math::
      f_{DistMult}=\langle \mathbf{r}_p, \mathbf{e}_s, \mathbf{e}_o \rangle
  
  where :math:`\mathbf{e}_{s}` is the embedding of the subject, :math:`\mathbf{r}_{p}` the embedding
  of the predicate and :math:`\mathbf{e}_{o}` the embedding of the object.
docstr: Compute scores using the distmult scoring function.
  
  Parameters
  ----------
  triples: array-like, shape (n, 3)
      Batch of input triples.
  
  Returns
  -------
  scores: tf.Tensor, shape (n,1)
      Tensor of scores of inputs.
code: def _compute_scores(self, triples):
      """Compute scores using the distmult scoring function.
  
      Parameters
      ----------
      triples: array-like, shape (n, 3)
          Batch of input triples.
  
      Returns
      -------
      scores: tf.Tensor, shape (n,1)
          Tensor of scores of inputs.
      """
      # compute scores as sum(s * p * o)
      scores = tf.reduce_sum(triples[0] * triples[1] * triples[2], 1)
      return scores
  
file_path: AmpliGraph/ampligraph/latent_features/layers/scoring/DistMult.py
imports: import tensorflow
  from .AbstractScoringLayer import register_layer, AbstractScoringLayer
label_desc: Use image node_id 3 for calling the DistMult obj's underlying member method code with example usage: obj._compute_scores(triples) and returns: scores