我是 Keras 的完整初学者。在https://keras.io/applications/的 Inception v3 示例中
# create the base pre-trained model
base_model = InceptionV3(weights='imagenet', include_top=False)
# add a global spatial average pooling layer
x = base_model.output
x = GlobalAveragePooling2D()(x)
# let's add a fully-connected layer
x = Dense(1024, activation='relu')(x)
# and a logistic layer -- let's say we have 200 classes
predictions = Dense(200, activation='softmax')(x)
作为第一步,它添加了一个 GlobalAveragePooling2D 层,描述为:
空间数据的全局平均池化操作。
GlobalAveragePooling2D 做了什么以及为什么该示例使用它而不是 Flatten 之类的东西?哪些信息是平均的?