From a4a9801c8004ea49a218240ae96468a4636ac9e4 Mon Sep 17 00:00:00 2001 From: Soumith Chintala Date: Fri, 3 Jun 2016 10:42:25 -0400 Subject: Revert "Fix bug with sgd individual learning rates" --- sgd.lua | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sgd.lua b/sgd.lua index d96bd4b..ea13c55 100644 --- a/sgd.lua +++ b/sgd.lua @@ -69,20 +69,15 @@ function optim.sgd(opfunc, x, config, state) end -- (4) learning rate decay (annealing) - local clr, clrs - if lrs then - clrs = lrs / (1 + nevals*lrd) - else - clr = lr / (1 + nevals*lrd) - end + local clr = lr / (1 + nevals*lrd) -- (5) parameter update with single or individual learning rates if lrs then if not state.deltaParameters then state.deltaParameters = torch.Tensor():typeAs(x):resizeAs(dfdx) end - state.deltaParameters:copy(clrs):cmul(dfdx) - x:add(-state.deltaParameters) + state.deltaParameters:copy(lrs):cmul(dfdx) + x:add(-clr, state.deltaParameters) else x:add(-clr, dfdx) end -- cgit v1.2.3