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

github.com/torch/optim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2016-09-06 20:34:02 +0300
committerGitHub <noreply@github.com>2016-09-06 20:34:02 +0300
commit0154acd51b80f97f5f52752c0a4f5af68d48b03f (patch)
tree206a787ede24ca8bd5a22408b4c3cdd7709cdbdf
parent3e11a8e7b22b8d9e809ee395f1c539e1c80024f5 (diff)
make initialMean to be configurable
-rw-r--r--rmsprop.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/rmsprop.lua b/rmsprop.lua
index 004cbd1..aa56200 100644
--- a/rmsprop.lua
+++ b/rmsprop.lua
@@ -29,6 +29,7 @@ function optim.rmsprop(opfunc, x, config, state)
local alpha = config.alpha or 0.99
local epsilon = config.epsilon or 1e-8
local wd = config.weightDecay or 0
+ local mfill = config.initialMean or 0
-- (1) evaluate f(x) and df/dx
local fx, dfdx = opfunc(x)
@@ -40,7 +41,7 @@ function optim.rmsprop(opfunc, x, config, state)
-- (3) initialize mean square values and square gradient storage
if not state.m then
- state.m = torch.Tensor():typeAs(x):resizeAs(dfdx):zero()
+ state.m = torch.Tensor():typeAs(x):resizeAs(dfdx):fill(mfill)
state.tmp = torch.Tensor():typeAs(x):resizeAs(dfdx)
end