class_docstr: Wraps a loss function in the `Loss` class.
  
  Example
  -------
  >>> import ampligraph.latent_features.loss_functions as lfs
  >>> def user_defined_loss(scores_pos, scores_neg):
  >>>    neg_exp = tf.exp(scores_neg)
  >>>    pos_exp = tf.exp(scores_pos)
  >>>    softmax_score = pos_exp / (tf.reduce_sum(neg_exp, axis=0) + pos_exp)
  >>>    loss = -tf.math.log(softmax_score)
  >>>    return loss
  >>> udf_loss = lfs.get(user_defined_loss)
  >>> isinstance(udf_loss, Loss)
  True
  >>> isinstance(udf_loss, LossFunctionWrapper)
  True
class_docstr_tok: ["Wraps","a","loss","function","in","the","`","Loss","`","class",".","Example","--","--","--","-",">",">",">","import","ampligraph.latent_features.loss_functions","as","lfs",">",">",">","def","user_defined_loss","(","scores_pos",",","scores_neg",")",":",">",">",">","neg_exp","=","tf.exp","(","scores_neg",")",">",">",">","pos_exp","=","tf.exp","(","scores_pos",")",">",">",">","softmax_score","=","pos_exp","\/","(","tf.reduce_sum","(","neg_exp",",","axis=0",")","+","pos_exp",")",">",">",">","loss","=","-tf.math.log","(","softmax_score",")",">",">",">","return","loss",">",">",">","udf_loss","=","lfs.get","(","user_defined_loss",")",">",">",">","isinstance","(","udf_loss",",","Loss",")","True",">",">",">","isinstance","(","udf_loss",",","LossFunctionWrapper",")","True"]
docstr: Initializes the LossFunctionWrapper.
  
  Parameters
  ----------
  user_defined_loss : function_handle
      Handle to loss function (should take 2 parameters as input).
  name: str
      Name of the loss function.
docstr_tok: ["Initializes","the","LossFunctionWrapper",".","Parameters","--","--","--","--","--","user_defined_loss",":","function_handle","Handle","to","loss","function","(","should","take","2","parameters","as","input",")",".","name",":","str","Name","of","the","loss","function","."]
code: def __init__(self, user_defined_loss, name=None):
      """Initializes the LossFunctionWrapper.
  
      Parameters
      ----------
      user_defined_loss : function_handle
          Handle to loss function (should take 2 parameters as input).
      name: str
          Name of the loss function.
      """
      super(LossFunctionWrapper, self).__init__()
      self._user_losses = user_defined_loss
      self.name = name
  
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 1 to create a new LossFunctionWrapper object from inherited base classes: Loss with example: obj = LossFunctionWrapper(user_defined_loss, name)