From f6d186782aa68b667843fc92e912fd9bc97169db Mon Sep 17 00:00:00 2001 From: ceci3 Date: Fri, 1 Mar 2019 16:04:49 +0800 Subject: [PATCH] test=develop --- python/paddle/fluid/layers/nn.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index e2c1a6541..8e1e48132 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -10567,17 +10567,17 @@ def npair_loss(anchor, positive, labels, l2_reg=0.002): ''' **Npair Loss Layer** - see http://www.nec-labs.com/uploads/images/Department-Images/MediaAnalytics/papers/nips16_npairmetriclearning.pdf - - Npair loss requires paired data. Npair loss has two parts, the first part is L2 - regularizer on the embedding vector, the second part is cross entropy loss which + Read `Improved Deep Metric Learning with Multi class N pair Loss Objective `_ . + + Npair loss requires paired data. Npair loss has two parts: the first part is L2 + regularizer on the embedding vector; the second part is cross entropy loss which takes the similarity matrix of anchor and positive as logits. Args: anchor(Variable): embedding vector for the anchor image. shape=[batch_size, embedding_dims] positive(Variable): embedding vector for the positive image. shape=[batch_size, embedding_dims] - labels(Varieble): 1-D tensor. shape=[batch_size] - l2_res(float32): L2 regularization term on embedding vector, default: 0.02 + labels(Variable): 1-D tensor. shape=[batch_size] + l2_reg(float32): L2 regularization term on embedding vector, default: 0.002 Returns: npair loss(Variable): return npair loss, shape=[1] -- GitLab