Can somebody explain what is a global max pooling layer and why and when do we use it for training a neural network. Do they have any advantage over ordinary max pooling layer?
Solved – global max pooling layer and what is its advantage over maxpooling layer
conv-neural-networkneural networkspooling
Best Answer
Global max pooling = ordinary max pooling layer with pool size equals to the size of the input (minus filter size + 1, to be precise). You can see that
MaxPooling1D
takes apool_length
argument, whereasGlobalMaxPooling1D
does not.For example, if the input of the max pooling layer is $0,1,2,2,5,1,2$, global max pooling outputs $5$, whereas ordinary max pooling layer with pool size equals to 3 outputs $2,2,5,5,5$ (assuming stride=1).
This can be seen in the code:
In some domains, such as natural language processing, it is common to use global max pooling. In some other domains, such as computer vision, it is common to use a max pooling that isn't global.