class_docstr: Rank cross entropy loss.
  
  Examples:
      >>> from keras import backend as K
      >>> softmax = lambda x: np.exp(x)/np.sum(np.exp(x), axis=0)
      >>> x_pred = K.variable(np.array([[1.0], [1.2], [0.8]]))
      >>> x_true = K.variable(np.array([[1], [0], [0]]))
      >>> expect = -np.log(softmax(np.array([[1.0], [1.2], [0.8]])))
      >>> loss = K.eval(RankCrossEntropyLoss(num_neg=2)(x_true, x_pred))
      >>> np.isclose(loss, expect[0]).all()
      True
docstr: :class:`RankCrossEntropyLoss` constructor.
  
  :param num_neg: number of negative instances in cross entropy loss.
docstr_tok: [":","class",":","`","RankCrossEntropyLoss","`","constructor",".",":","param","num_neg",":","number","of","negative","instances","in","cross","entropy","loss","."]
code: def __init__(self, num_neg: int = 1):
      """
      :class:`RankCrossEntropyLoss` constructor.
  
      :param num_neg: number of negative instances in cross entropy loss.
      """
      super().__init__(
          reduction=losses_utils.Reduction.SUM_OVER_BATCH_SIZE,
          name="rank_crossentropy",
      )
      self._num_neg = num_neg
  
file_path: MatchZoo/matchzoo/losses/rank_cross_entropy_loss.py
imports: import numpy
  import tensorflow
  from keras import layers, backend
  from keras.losses import Loss
  from keras.utils import losses_utils
label_desc: Use image node_id 1 to create a new RankCrossEntropyLoss object from inherited base classes: Loss with example: obj = RankCrossEntropyLoss(num_neg)