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:
Diffstat (limited to 'WeightedEuclidean.lua')
-rw-r--r--WeightedEuclidean.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/WeightedEuclidean.lua b/WeightedEuclidean.lua
index 5337eec..c4a1dbc 100644
--- a/WeightedEuclidean.lua
+++ b/WeightedEuclidean.lua
@@ -30,13 +30,15 @@ function WeightedEuclidean:reset(stdv)
else
stdv = 1./math.sqrt(self.templates:size(1))
end
-
- for i=1,self.templates:size(2) do
- self.templates:select(2, i):apply(function()
- return torch.uniform(-stdv, stdv)
- end)
+ if nn.oldSeed then
+ for i=1,self.templates:size(2) do
+ self.templates:select(2, i):apply(function()
+ return torch.uniform(-stdv, stdv)
+ end)
+ end
+ else
+ self.templates:uniform(-stdv, stdv)
end
-
self.diagCov:fill(1)
end