@@ -5831,7 +5831,7 @@ def rank_loss(label, left, right, name=None):
5831
5831
def margin_rank_loss (label , left , right , margin = 0.1 , name = None ):
5832
5832
"""
5833
5833
Margin Ranking Loss Layer for ranking problem,
5834
- which compare left score and right score passed in.
5834
+ which compares left score and right score passed in.
5835
5835
The ranking loss can be defined as following equation:
5836
5836
5837
5837
.. math::
@@ -5842,7 +5842,7 @@ def margin_rank_loss(label, left, right, margin=0.1, name=None):
5842
5842
label (Variable): Indicates whether the left is ranked higher than the right or not.
5843
5843
left (Variable): Ranking score for left.
5844
5844
right (Variable): Ranking score for right.
5845
- margin (float): Indicates the given margin to be added to right
5845
+ margin (float): Indicates the given margin.
5846
5846
name (str|None): A name for this layer (optional). If set None, the layer
5847
5847
will be named automatically.
5848
5848
Returns:
@@ -5857,12 +5857,12 @@ def margin_rank_loss(label, left, right, margin=0.1, name=None):
5857
5857
out = fluid.layers.margin_rank_loss(label, left, right)
5858
5858
"""
5859
5859
helper = LayerHelper ('margin_rank_loss' , ** locals ())
5860
- if not ( isinstance (label , Variable ) ):
5861
- raise ValueError ("The label should be a Variable" )
5862
- if not ( isinstance (left , Variable ) ):
5863
- raise ValueError ("The left should be a Variable" )
5864
- if not ( isinstance (right , Variable ) ):
5865
- raise ValueError ("The right should be a Variable" )
5860
+ if not isinstance (label , Variable ):
5861
+ raise ValueError ("The label should be a Variable. " )
5862
+ if not isinstance (left , Variable ):
5863
+ raise ValueError ("The left should be a Variable. " )
5864
+ if not isinstance (right , Variable ):
5865
+ raise ValueError ("The right should be a Variable. " )
5866
5866
out = helper .create_tmp_variable (left .dtype )
5867
5867
act = helper .create_tmp_variable (left .dtype )
5868
5868
helper .append_op (
0 commit comments