MarginRankingLossΒΆ

Creates a criterion that measures the loss given inputs x1, x2, two 1D mini-batch Tensors, and a label 1D mini-batch tensor y.

Abstract Signature:

MarginRankingLoss(margin: float = 0.0, reduction: str = mean)

PyTorch

API: torch.nn.functional.margin_ranking_loss
Strategy: Direct Mapping

Keras

API: keras.losses.MarginRankingLoss
Strategy: Direct Mapping

TensorFlow

API: tf.keras.losses.margin_ranking_loss
Strategy: Direct Mapping

Apple MLX

API: mlx.nn.losses.margin_ranking_loss
Strategy: Direct Mapping