From 0710648060b184af39798b42d74d8536f8b29c90 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 14 Apr 2015 10:19:43 -0700 Subject: [PATCH] fix a bug in #1977 (accum-grad) suggested by narihi --- src/caffe/solver.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/caffe/solver.cpp b/src/caffe/solver.cpp index 2b1896101d3..d4322d37cbf 100644 --- a/src/caffe/solver.cpp +++ b/src/caffe/solver.cpp @@ -636,7 +636,8 @@ void SGDSolver::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") { @@ -673,7 +674,8 @@ void SGDSolver::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") {