|
|
@ -5830,11 +5830,12 @@ def rank_loss(label, left, right, name=None):
|
|
|
|
|
|
|
|
|
|
|
|
def margin_rank_loss(label, left, right, margin=0.1, name=None):
|
|
|
|
def margin_rank_loss(label, left, right, margin=0.1, name=None):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
**Margin Rank loss layer for RankNet**
|
|
|
|
**Margin Rank loss layer for rank problem**
|
|
|
|
Args:
|
|
|
|
Args:
|
|
|
|
label (Variable): Indicats whether A ranked higher than B or not.
|
|
|
|
label (Variable): Indicats whether left higher than (right + margin) or not.
|
|
|
|
left (Variable): RankNet's output score for doc A.
|
|
|
|
left (Variable): rank score for left.
|
|
|
|
right (Variable): RankNet's output score for doc B.
|
|
|
|
right (Variable): rank score for right.
|
|
|
|
|
|
|
|
margin (float): Indicates the margin to be added to right
|
|
|
|
name (str|None): A name for this layer (optional). If set None, the layer
|
|
|
|
name (str|None): A name for this layer (optional). If set None, the layer
|
|
|
|
will be named automatically.
|
|
|
|
will be named automatically.
|
|
|
|
Returns:
|
|
|
|
Returns:
|
|
|
|