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