|
|
|
@ -5830,7 +5830,13 @@ def rank_loss(label, left, right, name=None):
|
|
|
|
|
|
|
|
|
|
def margin_rank_loss(label, left, right, margin=0.1, name=None):
|
|
|
|
|
"""
|
|
|
|
|
**Margin Rank loss layer for rank problem**
|
|
|
|
|
Margin Rank loss layer for rank problem, which comparing left value and right value be passed in.
|
|
|
|
|
The rank loss can be defined as below equation:
|
|
|
|
|
|
|
|
|
|
.. math::
|
|
|
|
|
|
|
|
|
|
rank\_loss &= max(0, -label * (left - right) + margin)
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
label (Variable): Indicats whether left higher than (right + margin) or not.
|
|
|
|
|
left (Variable): rank score for left.
|
|
|
|
|