diff options
Diffstat (limited to 'Euclidean.lua')
-rw-r--r-- | Euclidean.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Euclidean.lua b/Euclidean.lua index 808b7ab..c0dd99c 100644 --- a/Euclidean.lua +++ b/Euclidean.lua @@ -20,11 +20,14 @@ 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) + if nn.oldSeed then + for i=1,self.weight:size(2) do + self.weight:select(2, i):apply(function() + return torch.uniform(-stdv, stdv) + end) + end + else + self.weight:uniform(-stdv, stdv) end end |