SpatialDropout2D
类tf_keras.layers.SpatialDropout2D(rate, data_format=None, **kwargs)
Dropout 的空间二维版本。
此版本的功能与 Dropout 相同,但它会丢弃整个二维特征图,而不是单个元素。如果特征图中的相邻像素之间具有强相关性(这在早期卷积层中通常如此),那么常规 Dropout 不会对激活进行正则化,而只会导致有效学习率降低。在这种情况下,SpatialDropout2D 将有助于促进特征图之间的独立性,应改用此层。
参数
~/.keras/keras.json
中找到的 image_data_format
值(如果存在),否则使用 'channels_last'。默认为 'channels_last'。调用参数
输入形状
如果 data_format='channels_first',则为形状 (samples, channels, rows, cols)
的 4D 张量;如果 data_format='channels_last',则为形状 (samples, rows, cols, channels)
的 4D 张量。
输出形状 与输入相同
.
参考文献:- 使用卷积网络进行高效目标定位