Skip to content

Commit 35e547e

Browse files
committed
Polish API doc
test=develop
1 parent 9878eed commit 35e547e

File tree

1 file changed

+7
-6
lines changed
  • python/paddle/fluid/layers

1 file changed

+7
-6
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5830,20 +5830,21 @@ def rank_loss(label, left, right, name=None):
58305830

58315831
def margin_rank_loss(label, left, right, margin=0.1, name=None):
58325832
"""
5833-
**Margin Rank loss layer for RankNet**
5833+
**Margin Rank loss layer for rank problem**
58345834
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
58395840
will be named automatically.
58405841
Returns:
58415842
list: The value of rank loss.
58425843
Raises:
58435844
ValueError: Any of label, left, and right is not a variable.
58445845
Examples:
58455846
.. 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")
58475848
left = fluid.layers.data(name="left", shape=[4, 1], dtype="float32")
58485849
right = fluid.layers.data(name="right", shape=[4, 1], dtype="float32")
58495850
out = fluid.layers.margin_rank_loss(label, left, right)

0 commit comments

Comments
 (0)