@@ -5830,20 +5830,21 @@ def rank_loss(label, left, right, name=None):
5830
5830
5831
5831
def margin_rank_loss (label , left , right , margin = 0.1 , name = None ):
5832
5832
"""
5833
- **Margin Rank loss layer for RankNet **
5833
+ **Margin Rank loss layer for rank problem **
5834
5834
Args:
5835
- label (Variable): Indicats whether A ranked higher than B or not.
5836
- left (Variable): RankNet's output score for doc A.
5837
- right (Variable): RankNet's output score for doc B.
5838
- name(str|None): A name for this layer(optional). If set None, the layer
5835
+ label (Variable): Indicats whether left higher than (right + margin) or not.
5836
+ left (Variable): rank score for left.
5837
+ right (Variable): rank score for right.
5838
+ margin (float): Indicates the margin to be added to right
5839
+ name (str|None): A name for this layer (optional). If set None, the layer
5839
5840
will be named automatically.
5840
5841
Returns:
5841
5842
list: The value of rank loss.
5842
5843
Raises:
5843
5844
ValueError: Any of label, left, and right is not a variable.
5844
5845
Examples:
5845
5846
.. code-block:: python
5846
- label = fluid.layers.data(name="label", shape=[4, 1], dtype="float32")
5847
+ label = fluid.layers.data(name="label", shape=[4, 1], dtype="float32")
5847
5848
left = fluid.layers.data(name="left", shape=[4, 1], dtype="float32")
5848
5849
right = fluid.layers.data(name="right", shape=[4, 1], dtype="float32")
5849
5850
out = fluid.layers.margin_rank_loss(label, left, right)
0 commit comments