what is the difference between Flatten() and GlobalAveragePooling2D() in keras

后端 未结 3 2044
情深已故
情深已故 2020-12-24 14:15

I want to pass the output of ConvLSTM and Conv2D to a Dense Layer in Keras, what is the difference between using global average pooling and flatten Both is working in my cas

3条回答
  •  长发绾君心
    2020-12-24 14:55

    Flattening is No brainer and it simply converts a multi-dimensional object to one-dimensional by re-arranging the elements.

    While GlobalAveragePooling is a methodology used for better representation of your vector. It can be 1D/2D/3D. It uses a parser window which moves across the object and pools the data by averaging it (GlobalAveragePooling) or picking max value (GlobalMaxPooling). Padding is essentially required to take the corner cases into the account.

    Both are used for taking effect of sequencing into account in a simpler way.

提交回复
热议问题