Skip to content

Commit

Permalink
fix a bug in BVLC#1977 (accum-grad) suggested by narihi
Browse files Browse the repository at this point in the history
  • Loading branch information
weiliu89 committed Apr 14, 2015
1 parent 4d9b5d1 commit 0710648
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/caffe/solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,8 @@ void SGDSolver<Dtype>::ComputeUpdateValue() {
// Compute the value to history, and then copy them to the blob's diff.
Dtype local_rate = rate * net_params_lr[param_id]
/ this->param_.iter_size();
Dtype local_decay = weight_decay * net_params_weight_decay[param_id];
Dtype local_decay = weight_decay * net_params_weight_decay[param_id]
* this->param_.iter_size();

if (local_decay) {
if (regularization_type == "L2") {
Expand Down Expand Up @@ -673,7 +674,8 @@ void SGDSolver<Dtype>::ComputeUpdateValue() {
// Compute the value to history, and then copy them to the blob's diff.
Dtype local_rate = rate * net_params_lr[param_id]
/ this->param_.iter_size();
Dtype local_decay = weight_decay * net_params_weight_decay[param_id];
Dtype local_decay = weight_decay * net_params_weight_decay[param_id]
* this->param_.iter_size();

if (local_decay) {
if (regularization_type == "L2") {
Expand Down

0 comments on commit 0710648

Please sign in to comment.