I believe the first max pooling layer destroys 1 row and 1 col of data.
The input was 32x32 tensor, and after applying SpatialConvolutionMM(1, 32, 5, 5) we recovered a 32x28x28 tensor. Running SpatialMaxPooling(3, 3, 3, 3) should miss the last row and column of the 28x28 feature maps.
I tried to fix this by changing the pooling step to SpatialMaxPooling(3, 3, 3, 3, 2, 2 ), but recovered the error:
...lua/5.1/nn/THNN.lua:109: bad argument # 2 to 'v' (pad should be smaller than half of kernel size at /tmp/luarocks_nn-scm-1-2785 /nn/lib/THNN/generic/SpatialMaxPooling.c:108)
Can this be fixed simply by padding the pooling step? There's a similar loss of a row and col in the 2nd pooling step in this file.
I believe the first max pooling layer destroys 1 row and 1 col of data. The input was 32x32 tensor, and after applying SpatialConvolutionMM(1, 32, 5, 5) we recovered a 32x28x28 tensor. Running SpatialMaxPooling(3, 3, 3, 3) should miss the last row and column of the 28x28 feature maps.
I tried to fix this by changing the pooling step to SpatialMaxPooling(3, 3, 3, 3, 2, 2 ), but recovered the error: ...lua/5.1/nn/THNN.lua:109: bad argument # 2 to 'v' (pad should be smaller than half of kernel size at /tmp/luarocks_nn-scm-1-2785 /nn/lib/THNN/generic/SpatialMaxPooling.c:108)
Can this be fixed simply by padding the pooling step? There's a similar loss of a row and col in the 2nd pooling step in this file.