通过关注此网站
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)。其他功能(例如动量和重量衰减)应该按预期工作。
关于deep-learning - Caffe中Siamese网络的权重更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42553422/