Skip to content

Commit

Permalink
simpler lppooling with Avg pooling instead of SubSampling
Browse files Browse the repository at this point in the history
  • Loading branch information
szagoruyko committed Jan 22, 2015
1 parent 308fd54 commit 3f64a20
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions SpatialLPPooling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,17 @@ function SpatialLPPooling:__init(nInputPlane, pnorm, kW, kH, dW, dH)
self.dW = dW
self.dH = dH

self.nInputPlane = nInputPlane

if pnorm == 2 then
self:add(nn.Square())
else
self:add(nn.Power(pnorm))
end
self:add(nn.SpatialSubSampling(nInputPlane, kW, kH, dW, dH))
self:add(nn.SpatialAveragePooling(kW, kH, dW, dH))
if pnorm == 2 then
self:add(nn.Sqrt())
else
self:add(nn.Power(1/pnorm))
end

self:get(2).bias:zero()
self:get(2).weight:fill(1)
end

-- the module is a Sequential: by default, it'll try to learn the parameters
Expand Down

0 comments on commit 3f64a20

Please sign in to comment.