I am unable to understand why tensorflow maxpooling with my parameters.
When performed a maxpool with ksize=2
and strides=2
i get the following output with both padding SAME
and padding VALID
input : (?, 28, 28, 1)
conv2d_out : (?, 28, 28, 32)
maxpool2d_out : (?, 14, 14, 32)
But when I try to perfrom maxpool with ksize=3
and strides=1
, I get the following output:
input : (?, 28, 28, 1)
conv2d_out : (?, 28, 28, 32)
maxpool2d_out : (?, 28, 28, 32) PADDING SAME
maxpool2d_out : (?, 26, 26, 32) PADDING VALID
maxpool with ksize=2
and strides=2
using padding SAME
should have produced the output maxpool2d_out : (?, 28, 28, 32)
Is there something I missed out on how max pooling with padding works?
**CODE**==
python_
I saw in your code you use
padding=SAME
. When using the SAME paddding andstrides=1
, the input and output size are the same. Why do you think the tensorflow implementation is wrong?Update: According to tensorflow documentation:
Using SAME padding
Using VALID padding
It is celing((28-3+1)/1)= 26 when k=3, stride =1
It is ceiling((28-2+1)/2)= 14 when k=2, stride=2
As you can see, because of the ceiling function, your result happens to be the same using different PADDING configuration