diff options
author | Clement Farabet <clement.farabet@gmail.com> | 2011-11-03 20:07:50 +0400 |
---|---|---|
committer | Clement Farabet <clement.farabet@gmail.com> | 2011-11-03 20:07:50 +0400 |
commit | c50fb86972e8de08c97f0e95be86da4c27504710 (patch) | |
tree | b96dcc9d9c3e5cab96b5428fe134bb6948a3c4d0 /sgd.lua | |
parent | baba10e54fdfd7c18d69366113db52ddc5158baa (diff) |
Fixed eval counter for SGFixed eval counter for SGDD
Diffstat (limited to 'sgd.lua')
-rw-r--r-- | sgd.lua | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -21,7 +21,6 @@ function optim.sgd(opfunc, x, state) local mom = state.momentum or 0 local lrs = state.learningRates state.evalCounter = state.evalCounter or 0 - state.evalCounter = state.evalCounter + 1 local nevals = state.evalCounters -- (1) evaluate f(x) and df/dx @@ -56,6 +55,9 @@ function optim.sgd(opfunc, x, state) x:add(-clr, state.dfdx) end + -- (5) update evaluation counter + state.evalCounter = state.evalCounter + 1 + -- return f(x_old), and x_new return x,fx end |