三重损失反向传播梯度公式是什么? [英] What's the triplet loss back propagation gradient formula?
问题描述
我正在尝试使用 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屋!