happynear / caffe-windows

Configure Caffe in one hour for Windows users.
Other
1.32k stars 649 forks source link

关于inner_product_layer.cpp中权重w的问题 #292

Open xuezhongcailian opened 6 years ago

xuezhongcailian commented 6 years ago

image 大神好,请问: if (normalize_ && bottom.size() == 1)为真时,权重归一化,第二红线处为什么不是第一红线处的 mutable_weight?

happynear commented 6 years ago

这个只是指针,指向的Blob都一样。

zhaokai5 commented 5 years ago

你好,代码中该层反向传播时,只对归一化后的权重求反向梯度,而不是对原始的权重求反向梯度的吧,这个是不是有问题啊

happynear commented 5 years ago

@zhaokai5 这是一种实现形式,如果需要传给原始的权重,得用这个方案,传两个bottom blob到innerproduct layer里: https://github.com/happynear/NormFace/blob/master/prototxt/combine_softmax_contrastive.prototxt#L70