!45395 add marginrankingloss docs

Merge pull request !45395 from 冯一航/code_docs_add_margin_doc
This commit is contained in:
i-robot 2022-11-10 10:56:31 +00:00 committed by Gitee
commit a6fdae96e4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 4 additions and 0 deletions

View File

@ -3,4 +3,6 @@ mindspore.ops.margin_ranking_loss
.. py:function:: mindspore.ops.margin_ranking_loss(input1, input2, target, margin=0.0, reduction='mean')
排序损失函数,用于创建一个衡量给定损失的标准。
详情请参考 :class:`mindspore.nn.MarginRankingLoss`

View File

@ -3014,6 +3014,8 @@ def _get_loss(x, reduction, cls_name, weights=1.0):
def margin_ranking_loss(input1, input2, target, margin=0.0, reduction='mean'):
"""
MarginRankingLoss creates a criterion that measures the loss.
For details, please refer to :class:`mindspore.nn.MarginRankingLoss`.
"""
margin = _check_value_type("margin", margin, [float], "margin_ranking_loss")