diff options
author | Clement Farabet <clement.farabet@gmail.com> | 2011-10-09 21:07:12 +0400 |
---|---|---|
committer | Clement Farabet <clement.farabet@gmail.com> | 2011-10-09 21:07:12 +0400 |
commit | c42ff17b16bca9c4aa6d264cc2a79b3347a4b81f (patch) | |
tree | a945c58424dbdc396f09d53128defe07ec9ee63d | |
parent | 4c5078046e48494048cbe5f27d9b4be4bac07c9b (diff) |
Approx epsilon in hessian update.
-rw-r--r-- | test/test-hessian.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test-hessian.lua b/test/test-hessian.lua index ae02e73..cf6e42f 100644 --- a/test/test-hessian.lua +++ b/test/test-hessian.lua @@ -20,8 +20,8 @@ random.manualSeed(1) -- SGD params learningRate = 1e-3 -diagHessianEpsilon = 1e-2 -computeDiagHessian = true +diagHessianEpsilon = 1e-3 +computeDiagHessian = true -- SET THIS FLAG TO FALSE TO SEE THE EFFECT OF THE DIAG HESSIAN -- fake data inputs = {} @@ -61,10 +61,10 @@ if computeDiagHessian then end diagHessianParameters:div(#inputs) - -- protect diag hessian - diagHessianParameters:apply(function(x) - return math.max(x, diagHessianEpsilon) - end) + -- protect diag hessian (the proper way of doing it is the commented code, + -- but for speed reasons, the uncommented code just works) + --diagHessianParameters:apply(function(x) return math.max(x, diagHessianEpsilon) end) + diagHessianParameters:add(diagHessianEpsilon) -- now learning rates are obtained like this: learningRates:cdiv(diagHessianParameters) |