# What is the dimension of my output of the form (2n + 1, 2n + 1, #filters) after a MaxPooling layer

I'm trying to white board the different mechanisms behind a convolutional neural network. I have on question regarding the dimension of my volume after using a max pooling layer. Let's suppose I have a (21,21,#filtres) volume's dimension. If Max Pooling divide by 2 the height and width of my volume, what will be the dimension after the Max Pooling layer ? If odd numbers are a problem when using max pooling layer, How do I fix it ?

Thank you !

• Are you considering the stride parameter (available in most libraries)? If so, what is it set to? The default would be to set stride equal to the pooling size i.e. 2, and therefore divide layer size by 2. – Neil Slater Sep 2 at 14:15
• From the lectures I followed, stride was often set to 1. Make it equal to 2 will fix the problem ? – Valentin Sep 2 at 14:31
• If stride is set to 1 there is no problem, the pooling will not need to be applied partially in order to cover the whole input. Your output would be (20, 20, num_filters) though, it doesn't shrink the feature map as much. It still provides useful generalisation. Stride is often set to 1 for the convolutional layer, but not for pooling layers, so it may be the value you noticed from lectures was referring convolutional layers. – Neil Slater Sep 2 at 14:32

• The result will round up, so you will have a feature map layer with dimensions (11, 11, num_filters) although the right edge pixels will be a max over 2 pixels in the input, and the right bottom corner will just be a copy of the right bottom corner in the input (counting from top left as $$(0, 0)$$)