# Module: tfr.keras.losses

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/ranking/blob/v0.5.3/tensorflow_ranking/python/keras/losses.py) |

Keras losses in TF-Ranking.

## Classes

[`class ApproxMRRLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/ApproxMRRLoss): Computes approximate MRR loss between `y_true` and `y_pred`.

[`class ApproxNDCGLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/ApproxNDCGLoss): Computes approximate NDCG loss between `y_true` and `y_pred`.

[`class ClickEMLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/ClickEMLoss): Computes click EM loss between `y_true` and `y_pred`.

[`class CoupledRankDistilLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/CoupledRankDistilLoss): Computes the Rank Distil loss between `y_true` and `y_pred`.

[`class DCGLambdaWeight`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/DCGLambdaWeight): Keras serializable class for DCG.

[`class GumbelApproxNDCGLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/GumbelApproxNDCGLoss): Computes the Gumbel approximate NDCG loss between `y_true` and `y_pred`.

[`class LabelDiffLambdaWeight`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/LabelDiffLambdaWeight): Keras serializable class for LabelDiffLambdaWeight.

[`class ListMLELambdaWeight`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/ListMLELambdaWeight): LambdaWeight for ListMLE cost function.

[`class ListMLELoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/ListMLELoss): Computes ListMLE loss between `y_true` and `y_pred`.

[`class MeanSquaredLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/MeanSquaredLoss): Computes mean squared loss between `y_true` and `y_pred`.

[`class MixtureEMLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/MixtureEMLoss): Computes mixture EM loss between `y_true` and `y_pred`.

[`class NDCGLambdaWeight`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/NDCGLambdaWeight): Keras serializable class for NDCG.

[`class NDCGLambdaWeightV2`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/NDCGLambdaWeightV2): Keras serializable class for NDCG LambdaWeight V2 for topn.

[`class OrdinalLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/OrdinalLoss): Computes the Ordinal loss between `y_true` and `y_pred`.

[`class PairwiseHingeLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/PairwiseHingeLoss): Computes pairwise hinge loss between `y_true` and `y_pred`.

[`class PairwiseLogisticLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/PairwiseLogisticLoss): Computes pairwise logistic loss between `y_true` and `y_pred`.

[`class PairwiseMSELoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/PairwiseMSELoss): Computes pairwise mean squared error loss between `y_true` and `y_pred`.

[`class PairwiseSoftZeroOneLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/PairwiseSoftZeroOneLoss): Computes pairwise soft zero-one loss between `y_true` and `y_pred`.

[`class PrecisionLambdaWeight`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/PrecisionLambdaWeight): Keras serializable class for Precision.

[`class RankingLossKey`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/RankingLossKey): Ranking loss key strings.

[`class SigmoidCrossEntropyLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/SigmoidCrossEntropyLoss): Computes the Sigmoid cross-entropy loss between `y_true` and `y_pred`.

[`class SoftmaxLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/SoftmaxLoss): Computes Softmax cross-entropy loss between `y_true` and `y_pred`.

[`class UniqueSoftmaxLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/UniqueSoftmaxLoss): Computes unique softmax cross-entropy loss between `y_true` and `y_pred`.

[`class YetiDCGLambdaWeight`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/YetiDCGLambdaWeight): Keras serializable class for YetiDCGLambdaWeight.

[`class YetiLogisticLoss`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/YetiLogisticLoss): Computes Yeti logistic loss between `y_true` and `y_pred`.

## Functions

[`get(...)`](https://www.tensorflow.org/ranking/api_docs/python/tfr/keras/losses/get): Factory method to get a ranking loss class.