37. The difference between pooling and convolution

Pooling and Convolution are very similar in some cases, but there are many differences. One of the bigger differences is that although both have a kernel function, the convolution kernel and the pooling kernel are very different, and their functions are also very different.

The difference between the two is analyzed below to facilitate understanding of the differences between the two algorithms.

Calculation is different

For the convolution operation, the convolution kernel slides on the input data, and the local area of ​​ each time it slides is convolved with the convolution kernel (that is, multiplication Accumulation calculation), thereby generating an output feature map.

For pooling, there is also a pooling kernel sliding on the data, but it does not perform certain operations on the pooling kernel and the local area. The role of the pooling kernel is only to frame a pooling area. That's all. Calculate the maximum or average value of the framed pooling area based on maximum pooling and average pooling.

Parameters are different

Although they are all kernel functions, the parameters in the convolution kernel are learnable. When training the model, these parameters are adjusted through the back propagation algorithm so that the network can learn the features in the data.

The kernel function in the pooling operation has no parameters, that is to say, it is only a 2x2 or 3x3 pooling range, and there is no pooling parameter learning during the training process. Therefore, the result of the pooling operation is to reduce the dimensionality of the input data and reduce the spatial size.

Another most obvious point in the algorithm between the two is that the pooling operation only has one input, which is the input tensor, but the convolution operation has at least two inputs, one is the input tensor and the other is the convolution kernel.

Because the role of the pooling kernel is only to mark a pooling range, and there are no parameters that need to be learned in the kernel function, the pooling kernel does not need to be treated as an input tensor, but only as a parameter of pooling. Just treat it the same as parameters such as padding and stride.

Therefore, there is no accumulation operation between channels in pooling, and each channel is independent, which is very different from convolution.

Guess you like

Origin blog.csdn.net/dongtuoc/article/details/135025311