How the weight update works when back propagation?

103 views
Skip to first unread message

Tianqi Tang

unread,
Dec 20, 2015, 9:38:30 AM12/20/15
to Caffe Users
Dear All,
    I am reading the code of Backward function for layers. I find that the weight is updated as the following code, just assign the gradients to this->blobs_[0]->mutable_cpu_diff().
Is there something like "weight_new = weight_old + learn_rate*δ"? Where is it? And during the runtime, do the gradient assignment and the weight update work together?

 // Gradient with respect to weight
    caffe_cpu_gemm<Dtype>(CblasTrans, CblasNoTrans, N_, K_, M_, (Dtype)1.,
        top_diff, bottom_data, (Dtype)1., this->blobs_[0]->mutable_cpu_diff());


Thanks,
Tianqi 

Dana Shavit

unread,
Dec 22, 2015, 8:41:56 AM12/22/15
to Caffe Users
The update is performed several stages, first in the solver (e.g. SGDSolver.cpp) in SGDSolver<Dtype>::ComputeUpdateValue and then in Blob::Update() in Blob.cpp
D.
Reply all
Reply to author
Forward
0 new messages