Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/clementfarabet/lua---nnx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Farabet <clement.farabet@gmail.com>2011-10-09 21:07:12 +0400
committerClement Farabet <clement.farabet@gmail.com>2011-10-09 21:07:12 +0400
commitc42ff17b16bca9c4aa6d264cc2a79b3347a4b81f (patch)
treea945c58424dbdc396f09d53128defe07ec9ee63d
parent4c5078046e48494048cbe5f27d9b4be4bac07c9b (diff)
Approx epsilon in hessian update.
-rw-r--r--test/test-hessian.lua12
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)