Deep Learning - Pooling Layer

Pooling layer (pooling)


In the convolutional neural network, the pooling layer can effectively reduce the size of the matrix, which can not only speed up the calculation, but also prevent overfitting.

There are two commonly used pooling layers: max pooling and average pooling

The filter of the pooling layer is similar to the convolutional layer. The filter of the convolutional layer spans the entire depth, while the pooling layer only affects one node of the current depth, so the filter of the pooling layer should be in length and width. As well as moving in the three dimensions of depth.

The tensorflow implementation algorithm is as follows:
#tf.nn.max_pool implements the forward propagation process of the maximum pooling layer, and the parameters are similar to tf.nn.conv2d
#ksize provides the size of the filter (the first dimension and the last dimension can only be 1) , strides provides step size information (the first dimension and the last dimension can only be 1), and padding provides whether to use all 0 padding
pool = tf.nn.max_pool(activated_conv, ksize=[1,3,3,1],strides=[1,2,2,1], padding='SAME')

There are only two values ​​for the padding parameter: VALID means not to use all 0 padding
                                            SAME means padding with all zeros

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324834472&siteId=291194637