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:
authorSoumith Chintala <soumith@gmail.com>2015-03-04 16:35:10 +0300
committerSoumith Chintala <soumith@gmail.com>2015-03-04 16:35:10 +0300
commit31bf6a663f010e7873bcb7d8603420b82f9beb5d (patch)
treef40f5a2df5c6e97643a17186954f42c54c8f23c2
parent19ae57a0e14e6b580f1555929592c9032c82d3f6 (diff)
Revert "Fixed SpatialAveragePooling - added division by filter size"
-rw-r--r--generic/SpatialAveragePooling.c4
-rw-r--r--test.lua4
2 files changed, 4 insertions, 4 deletions
diff --git a/generic/SpatialAveragePooling.c b/generic/SpatialAveragePooling.c
index 0c20ef6..2052d05 100644
--- a/generic/SpatialAveragePooling.c
+++ b/generic/SpatialAveragePooling.c
@@ -83,7 +83,7 @@ static int nn_(SpatialAveragePooling_updateOutput)(lua_State *L)
ptr_input += inputWidth; /* next input line */
}
/* Update output */
- *ptr_output++ += sum/kW/kH;
+ *ptr_output++ += sum;
}
}
}
@@ -163,7 +163,7 @@ static int nn_(SpatialAveragePooling_updateGradInput)(lua_State *L)
for(ky = 0; ky < kH; ky++)
{
for(kx = 0; kx < kW; kx++)
- ptr_gradInput[kx] += z/kW/kH;
+ ptr_gradInput[kx] += z;
ptr_gradInput += inputWidth;
}
}
diff --git a/test.lua b/test.lua
index 63697b9..f1576fc 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/ki/kj)
+ sap.weight:fill(1.0)
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/ki/kj)
+ sap.weight:fill(1.0)
sap.bias:fill(0.0)
local output = module:forward(input)