提交 35e547e0 编写于 作者: M minqiyang

Polish API doc

test=develop
上级 9878eedb
...@@ -5830,12 +5830,13 @@ def rank_loss(label, left, right, name=None): ...@@ -5830,12 +5830,13 @@ 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.
name(str|None): A name for this layer(optional). If set None, the layer margin (float): Indicates the margin to be added to right
name (str|None): A name for this layer (optional). If set None, the layer
will be named automatically. will be named automatically.
Returns: Returns:
list: The value of rank loss. list: The value of rank loss.
...@@ -5843,7 +5844,7 @@ def margin_rank_loss(label, left, right, margin=0.1, name=None): ...@@ -5843,7 +5844,7 @@ def margin_rank_loss(label, left, right, margin=0.1, name=None):
ValueError: Any of label, left, and right is not a variable. ValueError: Any of label, left, and right is not a variable.
Examples: Examples:
.. code-block:: python .. code-block:: python
label = fluid.layers.data(name="label", shape=[4, 1], dtype="float32") label = fluid.layers.data(name="label", shape=[4, 1], dtype="float32")
left = fluid.layers.data(name="left", shape=[4, 1], dtype="float32") left = fluid.layers.data(name="left", shape=[4, 1], dtype="float32")
right = fluid.layers.data(name="right", shape=[4, 1], dtype="float32") right = fluid.layers.data(name="right", shape=[4, 1], dtype="float32")
out = fluid.layers.margin_rank_loss(label, left, right) out = fluid.layers.margin_rank_loss(label, left, right)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册