From cb303329bd82f1bb80d3c7eebc14d41195acec83 Mon Sep 17 00:00:00 2001 From: Sergey Zagoruyko Date: Wed, 4 Mar 2015 15:39:05 +0100 Subject: SpatialAveragePooling divides by kW*kH --- test.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test.lua') 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) -- cgit v1.2.3