In a typical Convolutional Neural Network (CNN) architecture, what is the primary function of the pooling layer?