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

ycdaskin picture ycdaskin  路  100Comments

henry0312 picture henry0312  路  162Comments

lmoesch picture lmoesch  路  89Comments

hotplot picture hotplot  路  59Comments

parag2489 picture parag2489  路  64Comments