Keras: GlobalAveragePooling2D vs Flatten() on pretrained model

Created on 13 Nov 2017  路  1Comment  路  Source: keras-team/keras

In keras pretrained model (keras applications page). tutorial uses GlobalAveragePooling2D() before feeding to customized top layers. What GlobalAveragePooling2D() does? and why not using Flatten(), since these are going to be fed to FC layers? what would be the best practice in this matter if I use VGG16 or VGG19, or inception V3 with customized top layers?

Thanks.

Most helpful comment

Both Flatten and GlobalAveragePooling2D are valid options. So is GlobalMaxPooling2D.

Flatten will result in a larger Dense layer afterwards, which is more expensive and may result in worse overfitting. But if you have lots of data, it might also perform better.

As usual, it depends completely on your problem.

>All comments

Both Flatten and GlobalAveragePooling2D are valid options. So is GlobalMaxPooling2D.

Flatten will result in a larger Dense layer afterwards, which is more expensive and may result in worse overfitting. But if you have lots of data, it might also perform better.

As usual, it depends completely on your problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vinayakumarr picture vinayakumarr  路  3Comments

oweingrod picture oweingrod  路  3Comments

LuCeHe picture LuCeHe  路  3Comments

braingineer picture braingineer  路  3Comments

anjishnu picture anjishnu  路  3Comments