From b0ae52a2c8d48ecea47100fe10653fca6dad3cc7 Mon Sep 17 00:00:00 2001 From: yangguohao <70266361+yangguohao@users.noreply.github.com> Date: Fri, 20 May 2022 17:14:24 +0800 Subject: [PATCH] Update loss.py --- python/paddle/nn/functional/loss.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/paddle/nn/functional/loss.py b/python/paddle/nn/functional/loss.py index 6a7e79b4a392f..1a3f3f25302a6 100755 --- a/python/paddle/nn/functional/loss.py +++ b/python/paddle/nn/functional/loss.py @@ -2231,8 +2231,8 @@ def triplet_margin_with_distance_loss(input, positive, negative, distance_function = None, - swap=False, margin=1.0, + swap=False, reduction='mean', name=None): r""" @@ -2270,13 +2270,13 @@ def triplet_margin_with_distance_loss(input, The shape of label is the same as the shape of input. distance_function (callable, optional): Quantifies the distance between two tensors. if not specified, 2 norm functions will be used. - + + margin (float, optional):Default: :math:`1`.A nonnegative margin representing the minimum difference + between the positive and negative distances required for the loss to be 0. + swap (bool, optional):The distance swap changes the negative distance to the swap distance (distance between positive samples and negative samples) if swap distance smaller than negative distance. Default: ``False``. - margin (float, optional):Default: :math:`1`.A nonnegative margin representing the minimum difference - between the positive and negative distances required for the loss to be 0. - reduction (str, optional):Indicate how to average the loss by batch_size. the candicates are ``'none'`` | ``'mean'`` | ``'sum'``. If :attr:`reduction` is ``'none'``, the unreduced loss is returned;