diff options
Diffstat (limited to 'TemporalSubSampling.lua')
-rw-r--r-- | TemporalSubSampling.lua | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/TemporalSubSampling.lua b/TemporalSubSampling.lua index 3d06f6e..29df8b1 100644 --- a/TemporalSubSampling.lua +++ b/TemporalSubSampling.lua @@ -23,14 +23,17 @@ function TemporalSubSampling:reset(stdv) else stdv = 1/math.sqrt(self.kW) end - - self.weight:apply(function() - return torch.uniform(-stdv, stdv) - end) - - self.bias:apply(function() - return torch.uniform(-stdv, stdv) - end) + if nn.oldSeed then + self.weight:apply(function() + return torch.uniform(-stdv, stdv) + end) + self.bias:apply(function() + return torch.uniform(-stdv, stdv) + end) + else + self.weight:uniform(-stdv, stdv) + self.bias:uniform(-stdv, stdv) + end end function TemporalSubSampling:updateOutput(input) |