kerasadf.layers.pooling.AveragePooling2D

class kerasadf.layers.pooling.AveragePooling2D(pool_size=(2, 2), strides=None, padding='valid', data_format=None, **kwargs)

Bases: Pooling2D

Average pooling layer for 2D inputs.

Assumed Density Filtering (ADF) version of keras.layers.AveragePooling2D.

Parameters:
pool_sizeint or tuple of int, 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).

stridesint or tuple of int or None

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, the pool_size will be used. Default is None.

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 the image_data_format value found in your Keras config file at ~/.keras/keras.json. If you never set it, then it will be “channels_last”.

Notes

Input shape

4D tensor with shape (batch_size, rows, cols, channels) if data_format is “channels_last” or shape (batch_size, channels, rows, cols) if data_format is “channels_first”.

Output shape

4D tensor with shape (batch_size, pooled_rows, pooled_cols, channels) if data_format is “channels_last” or shape (batch_size, channels, pooled_rows, pooled_cols) if data_format is “channels_first”.

call(inputs)