三重损失反向传播梯度公式是什么?

编程入门 行业动态 更新时间:2024-10-17 09:54:20
本文介绍了三重损失反向传播梯度公式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用 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.

更多推荐

三重损失反向传播梯度公式是什么?

本文发布于:2023-11-29 20:52:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1647602.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:梯度   公式   损失

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!