10

For the even image dimension case, max pooling is simple to understand - it simply performs convolution over the image with the max operator with a $x$-by-$x$ kernel with a stride of $x$. However for the case of images with odd image dimensions, you have to make a design choice: do you zero-pad the image then max pool or do you simply crop out the last column/row? How is this handled by standard max pooling layers in, say, Theano and Tensorflow? I'm wondering because when I use Theano, the image dimensions are reduced by integer division (which uses a floor function), which suggests that the second method is used, since if you were to zero-pad this would result in "ceiling division" (division followed by the ceiling function instead of the floor function).

AGentleRose
  • 121
  • 1
  • 1
  • 5
  • 2
    This link seems to explain how Tensorflow handles the situation: http://stackoverflow.com/questions/37674306/what-is-the-difference-between-same-and-valid-padding-in-tf-nn-max-pool-of-t – liangjy Jan 18 '17 at 20:36
  • Keras/Tensorflow seems to be cropping the last columns by default. – Lugi Feb 08 '18 at 11:51
  • 1
    I'm voting to close this question as off-topic because the answer entirely depends on software implementations -- there's no mathematical or statistical content. – Sycorax Jun 01 '18 at 21:16
  • @Sycorax I agree, it didn't really fit into CV, thank you for closing. – AGentleRose Jun 03 '18 at 01:45

0 Answers0