What's the triplet loss back propagation gradient formula?

随声附和 提交于 2019-11-28 18:57:16
Shai

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!