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

github.com/torch/nn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoray Kavukcuoglu <koray@kavukcuoglu.org>2012-02-19 20:36:19 +0400
committerKoray Kavukcuoglu <koray@kavukcuoglu.org>2012-02-19 20:36:19 +0400
commitaa0b8ed695b8c57610d3339d994b0c126318a097 (patch)
tree80fa06ac02f391547fd96ee1411a424788ea9d9e
parenta26721d16d2468aec39bfdd189f96a77a05fab45 (diff)
Add reset function to module.lua and Sequential.lua. CmdLine accepts ignore=false for string function
-rw-r--r--Module.lua3
-rw-r--r--Sequential.lua6
2 files changed, 9 insertions, 0 deletions
diff --git a/Module.lua b/Module.lua
index 2ae8115..98ee86c 100644
--- a/Module.lua
+++ b/Module.lua
@@ -131,6 +131,9 @@ function Module:cuda()
return self:type('torch.CudaTensor')
end
+function Module:reset()
+end
+
function Module:getParameters()
-- get parameters
local parameters,gradParameters = self:parameters()
diff --git a/Sequential.lua b/Sequential.lua
index 3e23350..a368964 100644
--- a/Sequential.lua
+++ b/Sequential.lua
@@ -89,6 +89,12 @@ function Sequential:share(mlp,...)
end
end
+function Sequential:reset(stdv)
+ for i=1,#self.modules do
+ self.modules[i]:reset(stdv)
+ end
+end
+
function Sequential:parameters()
local function tinsert(to, from)
if type(from) == 'table' then