Let's see a slightly different type of layer, pooling layers, and, more specifically, we'll go in to the details of max pooling and average pooling.
Pooling layers
Max pooling
Let's first explore how max pooling works. Similar to the convolution, we have the same parameters, the filter size is 2 x 2, the stride defines how big the step is, and we won't use any padding here:
Max pooling simply outputs the maximum of the selected values from the filter window, and, in this case, it would be nine.
It then moves the window on the right:
In this case, it moves two steps because of the stride, and outputs the maximum of the selected values, which is three.
It then moves down two steps and it outputs eight:
...