I just started working with keras and noticed that there are two layers with very similar names for max-pooling: MaxPool
and MaxPooling
. I was surprised that I couldn't find the difference between these two on Google; so I am wondering what the difference is between the two if any.
Max pooling operation for 2D spatial data. Downsamples the input along its spatial dimensions (height and width) by taking the maximum value over an input window (of size defined by pool_size ) for each channel of the input. The window is shifted by strides along each dimension.
Applies a 2D max pooling over an input signal composed of several input planes. If padding is non-zero, then the input is implicitly padded with negative infinity on both sides for padding number of points. dilation controls the spacing between the kernel points.
The 1D Global max pooling block takes a 2-dimensional tensor tensor of size (input size) x (input channels) and computes the maximum of all the (input size) values for each of the (input channels).
The 2D Global max pooling block takes a tensor of size (input width) x (input height) x (input channels) and computes the max value of all values across the entire (input width) x (input height) matrix for each of the (input channels).
They are basically the same thing (i.e. aliases of each other). For future readers who might want to know how this could be determined: go to the documentation page of the layer (you can use the list here) and click on "View aliases". This is then accompanied by a blue plus sign (+).
For example, if you go to MaxPool2D
documentation and do this, you will find MaxPooling2D
in the list of aliases of this layer as follow:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With