class_docstr: Translating Embeddings (TransE) scoring layer.
  
  The model as described in :cite:`bordes2013translating`.
  
  The scoring function of TransE computes a similarity between the embedding of the subject
  :math:`\mathbf{e}_{sub}` translated by the embedding of the predicate :math:`\mathbf{e}_{pred}`,
  and the embedding of the object :math:`\mathbf{e}_{obj}`,
  using the :math:`L_1` or :math:`L_2` norm :math:`||\cdot||` (default: :math:`L_1`):
  
  .. math::
      f_{TransE}=-||\mathbf{e}_{sub} + \mathbf{e}_{pred} - \mathbf{e}_{obj}||
  
  Such scoring function is then used on positive and negative triples :math:`t^+, t^-` in the loss function.
docstr: Compute scores using transE scoring function.
  
  Parameters
  ----------
  triples: array-like, (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 transE scoring function.
  
      Parameters
      ----------
      triples: array-like, (n, 3)
          Batch of input triples.
  
      Returns
      -------
      scores: tf.Tensor, shape (n,1)
          Tensor of scores of inputs.
      """
      # compute scores as -|| s + p - o||
      scores = tf.negative(
          tf.norm(triples[0] + triples[1] - triples[2], axis=1, ord=1)
      )
      return scores
  
file_path: AmpliGraph/ampligraph/latent_features/layers/scoring/TransE.py
imports: import tensorflow
  from .AbstractScoringLayer import register_layer, AbstractScoringLayer
label_desc: Use image node_id 3 for calling the TransE obj's underlying member method code with example usage: obj._compute_scores(triples) and returns: scores