matchzoo.losses.rank_cross_entropy_loss
¶
The rank cross entropy loss.
Module Contents¶
-
class
matchzoo.losses.rank_cross_entropy_loss.
RankCrossEntropyLoss
(num_neg:int=1)¶ Bases:
torch.nn.Module
Creates a criterion that measures rank cross entropy loss.
-
__constants__
= ['num_neg']¶
-
num_neg
¶ num_neg getter.
-
forward
(self, y_pred:torch.Tensor, y_true:torch.Tensor)¶ Calculate rank cross entropy loss.
Parameters: - y_pred – Predicted result.
- y_true – Label.
Returns: Rank cross loss.
-