kerasadf.layers.pooling.AveragePooling2D¶
-
class
kerasadf.layers.pooling.AveragePooling2D(pool_size=(2, 2), strides=None, padding='valid', data_format=None, **kwargs)¶ Bases:
kerasadf.layers.pooling.Pooling2DAverage pooling layer for 2D inputs.
Assumed Density Filtering (ADF) version of
keras.layers.AveragePooling2D.- Parameters
- pool_size
intortupleofint, optional An integer or tuple/list of two integers,
(pool_height, pool_width)specifying the size of the pooling window. Can be a single integer to specify the same value for all spatial dimensions. Default is(2,2).- strides
intortupleofintorNone An integer or tuple/list of two integers, specifying the strides of the pooling operation. Can be a single integer to specify the same value for all spatial dimensions. If
None, thepool_sizewill be used. Default isNone.- padding{“valid”, “same”}, optional
The padding method. Case-insensitive. Default is “valid”.
- data_format{“channels_last”, “channels_first”}, optional
The ordering of the dimensions in the inputs. “channels_last” corresponds to inputs with shape
(batch, height, width, channels)while “channels_first” corresponds to inputs with shape(batch, channels, height, width). It defaults to theimage_data_formatvalue found in your Keras config file at~/.keras/keras.json. If you never set it, then it will be “channels_last”.
- pool_size
Notes
- Input shape
4D tensor with shape
(batch_size, rows, cols, channels)ifdata_formatis “channels_last” or shape(batch_size, channels, rows, cols)ifdata_formatis “channels_first”.- Output shape
4D tensor with shape
(batch_size, pooled_rows, pooled_cols, channels)ifdata_formatis “channels_last” or shape(batch_size, channels, pooled_rows, pooled_cols)ifdata_formatis “channels_first”.
-
call(self, inputs)¶