From 06c01d82f9a0f7e3e3d11fe95ccd6ec4134b1702 Mon Sep 17 00:00:00 2001 From: fengyihang Date: Thu, 10 Nov 2022 14:29:25 +0800 Subject: [PATCH] add marginrankingloss docs --- .../api_python/ops/mindspore.ops.func_margin_ranking_loss.rst | 2 ++ mindspore/python/mindspore/ops/function/nn_func.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/api/api_python/ops/mindspore.ops.func_margin_ranking_loss.rst b/docs/api/api_python/ops/mindspore.ops.func_margin_ranking_loss.rst index f856b8a2ed4..1df8920846a 100644 --- a/docs/api/api_python/ops/mindspore.ops.func_margin_ranking_loss.rst +++ b/docs/api/api_python/ops/mindspore.ops.func_margin_ranking_loss.rst @@ -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`。 diff --git a/mindspore/python/mindspore/ops/function/nn_func.py b/mindspore/python/mindspore/ops/function/nn_func.py index 43e9465713b..c57e81594a5 100644 --- a/mindspore/python/mindspore/ops/function/nn_func.py +++ b/mindspore/python/mindspore/ops/function/nn_func.py @@ -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")