三重损失反向传播梯度公式是什么? [英] What's the triplet loss back propagation gradient formula?

查看:44
本文介绍了三重损失反向传播梯度公式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 caffe 来实现

渐变 w.r.t 锚"输入 (fa):

梯度 w.r.t 正"输入 (fp):

梯度 w.r.t 负"输入 (fn):

<小时>

原来的计算(我出于感情原因离开这里……)

请参阅评论 更正最后一项.

I am trying to use caffe to implement triplet loss described in Schroff, Kalenichenko and Philbin "FaceNet: A Unified Embedding for Face Recognition and Clustering", 2015.

I am new to this so how to calculate the gradient in back propagation?

解决方案

I assume you define the loss layer as

layer {
  name: "tripletLoss"
  type: "TripletLoss"
  bottom: "anchor"
  bottom: "positive"
  bottom: "negative"
  ...
}

Now you need to compute a gradient w.r.t each of the "bottom"s.

The loss is given by:

The gradient w.r.t the "anchor" input (fa):

The gradient w.r.t the "positive" input (fp):

The gradient w.r.t the "negative" input (fn):


The original calculation (I leave here for sentimental reasons...)

Please see comment correcting the last term.

这篇关于三重损失反向传播梯度公式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆