# Pooling layer

A pooling layer is a common type of layer in a convolutional neural network (CNN). A pooling layer does not contain any weights that need to be learned during neural network training.

However, pooling layers come with two hyperparameters: - Stride $$s$$ - Filter (or kernel) size $$f$$

Both of these hyperparameters have the same meaning as they do for convolutional layers.

Pooling layers help reduce the amount of computation a convolutional neural network needs, and can often help increase the performance of a CNN.

A pooling layer will turn an $$n \times n$$ matrix into a $$\left \lfloor \frac{n - f}{s} \right ]\rfloor + 1 \times \left \lfloor \frac{n - f}{s} \right ]\rfloor + 1$$ matrix.

There are several types of pooling: - Max pooling, the most common type of pooling in convolutional neural networks. - Average pooling. - Global Average Pooling (GAP). - $$k$$-Max Pooling and the closely-related Dynamic $$k$$-Max Pooling, which have found applications in neural networks for natural language processing.