Caffe 中 Siamese 网络的权重更新

Weight update of Siamese networks in Caffe

通过关注此网站

http://caffe.berkeleyvision.org/gathered/examples/siamese.html

, 我可以在 Caffe 中使用 Siamese 网络,它共享每一层的权重。

但是,我想知道 Caffe 中的 Siamese 网络如何更新它们的共享权重。 具体来说,如果我们有

input1 -> conv1(shared) -> output1

input2 -> conv1(shared) -> output2 ===> contrastive loss (from output1 and output2),

那么,Caffe 是否只是将来自第一个和第二个网络的 conv1 的两个梯度相加?

提前感谢您的回复。

你是对的,共享权重(所有同名参数)的差异(梯度)是累积的。 请注意,您不能对共享权重使用不同的学习率乘数 (lr_mult)。动量和重量衰减等其他功能应该按预期工作。