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:
authorSergey Zagoruyko <zagoruyko2@gmail.com>2015-03-04 17:39:05 +0300
committerSergey Zagoruyko <zagoruyko2@gmail.com>2015-03-04 17:39:05 +0300
commitcb303329bd82f1bb80d3c7eebc14d41195acec83 (patch)
treecf3fc5fcafe6392e5c11e657c3809e9e070de855 /test.lua
parent7470cc81d458066d751156df52d05d3482411e6c (diff)
SpatialAveragePooling divides by kW*kH
Diffstat (limited to 'test.lua')
-rw-r--r--test.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/test.lua b/test.lua
index f1576fc..8f5fbaa 100644
--- a/test.lua
+++ b/test.lua
@@ -1706,7 +1706,7 @@ function nntest.SpatialAveragePooling()
mytester:asserteq(berr, 0, torch.typename(module) .. ' - i/o backward err ')
local sap = nn.SpatialSubSampling(from, ki, kj, si, sj)
- sap.weight:fill(1.0)
+ sap.weight:fill(1.0/(ki*kj))
sap.bias:fill(0.0)
local output = module:forward(input)
@@ -1737,7 +1737,7 @@ function nntest.SpatialAveragePooling()
mytester:asserteq(berr, 0, torch.typename(module) .. ' - i/o backward err (Batch) ')
local sap = nn.SpatialSubSampling(from, ki, kj, si, sj)
- sap.weight:fill(1.0)
+ sap.weight:fill(1.0/(ki*kj))
sap.bias:fill(0.0)
local output = module:forward(input)