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:
authorClement Farabet <clement.farabet@gmail.com>2012-10-27 23:11:06 +0400
committerClement Farabet <clement.farabet@gmail.com>2012-10-27 23:11:06 +0400
commitdcaf75da2001c98043ecd27f8b12413dd27e75af (patch)
treeb8b267d10e51f33f366084aec06d183af7d4c94d /Euclidean.lua
parent6160010cbc434e02ab3b8f2c414afd96a5fb2c30 (diff)
Faster reset for 'nn' modules.
Diffstat (limited to 'Euclidean.lua')
-rw-r--r--Euclidean.lua7
1 files changed, 1 insertions, 6 deletions
diff --git a/Euclidean.lua b/Euclidean.lua
index 808b7ab..ca0dc33 100644
--- a/Euclidean.lua
+++ b/Euclidean.lua
@@ -20,12 +20,7 @@ function Euclidean:reset(stdv)
else
stdv = 1./math.sqrt(self.weight:size(1))
end
-
- for i=1,self.weight:size(2) do
- self.weight:select(2, i):apply(function()
- return torch.uniform(-stdv, stdv)
- end)
- end
+ self.weight:uniform(-stdv, stdv)
end
function Euclidean:updateOutput(input)