class_docstr: Abstract class for the loss function.
class_docstr_tok: ["Abstract","class","for","the","loss","function","."]
docstr: Interface to external world.
  
  This function does the input checks, preprocesses input and finally applies loss function.
  
  Parameters
  ----------
  scores_pos : tf.Tensor
      A tensor of scores assigned to positive statements.
  scores_neg : tf.Tensor
      A tensor of scores assigned to negative statements.
  eta: tf.Tensor
     Number of synthetic corruptions per positive.
  regularization_losses: list
     List of all regularization related losses defined in the layers.
  
  Returns
  -------
  loss : tf.Tensor
      The loss value that must be minimized.
docstr_tok: ["Interface","to","external","world",".","This","function","does","the","input","checks",",","preprocesses","input","and","finally","applies","loss","function",".","Parameters","--","--","--","--","--","scores_pos",":","tf.Tensor","A","tensor","of","scores","assigned","to","positive","statements",".","scores_neg",":","tf.Tensor","A","tensor","of","scores","assigned","to","negative","statements",".","eta",":","tf.Tensor","Number","of","synthetic","corruptions","per","positive",".","regularization_losses",":","list","List","of","all","regularization","related","losses","defined","in","the","layers",".","Returns","--","--","--","-","loss",":","tf.Tensor","The","loss","value","that","must","be","minimized","."]
code: def __call__(
      self, scores_pos, scores_neg, eta, regularization_losses=None
  ):
      """Interface to external world.
  
      This function does the input checks, preprocesses input and finally applies loss function.
  
      Parameters
      ----------
      scores_pos : tf.Tensor
          A tensor of scores assigned to positive statements.
      scores_neg : tf.Tensor
          A tensor of scores assigned to negative statements.
      eta: tf.Tensor
         Number of synthetic corruptions per positive.
      regularization_losses: list
         List of all regularization related losses defined in the layers.
  
      Returns
      -------
      loss : tf.Tensor
          The loss value that must be minimized.
      """
  
      loss_values = []
  
      scores_neg = tf.reshape(scores_neg, [eta, -1])
  
      loss = self._apply_loss(scores_pos, scores_neg)
      loss_values.append(tf.reduce_sum(loss))
      if regularization_losses:
          regularization_losses = (
              losses_utils.cast_losses_to_common_dtype(
                  regularization_losses
              )
          )
          reg_loss = math_ops.add_n(regularization_losses)
          loss_values.append(reg_loss)
  
      loss_values = losses_utils.cast_losses_to_common_dtype(
          loss_values
      )
      total_loss = math_ops.add_n(loss_values)
      self._loss_metric.update_state(total_loss)
      return total_loss
  
imports: import abc
  import logging
  import six
  import tensorflow
  from tensorflow.python.keras import metrics
  from tensorflow.python.keras.utils import losses_utils
  from tensorflow.python.ops import math_ops
label_desc: Use image node_id 7 for calling the Loss obj's underlying member method code with example usage: obj.__call__(scores_pos, scores_neg, eta, regularization_losses) and returns: total_loss