Search code examples
machine-learningkerasdeep-learningconv-neural-networkmax-pooling

What is the pool size of global pooling operations?


In normal pooling operations we have to mention pool size for pooling operation, like for 2D pooling operations we mention (2,2); however, in global pooling operation it is not required. So is it the same size as input? I am working on Keras. Here one author mentions that the pooling size is the same as input size or input size-filter size+1. Which one is correct?


Solution

  • In case of 1D pooling, as mentioned in Keras docs, it takes as input an array of shape (batch_size, steps, features) and its output shape is (batch_size, features). So the pool size is equal to steps.

    In case of 2D pooling, as mentioned in Keras docs, it takes as input an array of shape (batch_size, rows, cols, channels) and its output shape is (batch_size, channels). So the pool size is equal to (rows, cols).

    In both cases, the pool size is consistent with the intuition behind it: taking maximum value over the whole data axes (i.e. global).