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 'SpatialSubSampling.lua')
-rw-r--r--SpatialSubSampling.lua17
1 files changed, 11 insertions, 6 deletions
diff --git a/SpatialSubSampling.lua b/SpatialSubSampling.lua
index 48b32b9..19aa2f5 100644
--- a/SpatialSubSampling.lua
+++ b/SpatialSubSampling.lua
@@ -26,12 +26,17 @@ function SpatialSubSampling:reset(stdv)
else
stdv = 1/math.sqrt(self.kW*self.kH)
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 SpatialSubSampling:updateOutput(input)