kerasadf.layers.pooling.Pooling2D¶
-
class
kerasadf.layers.pooling.Pooling2D(pool_function, pool_size, strides, padding='valid', data_format=None, **kwargs)¶ Bases:
kerasadf.layers.core.ADFLayerPooling layer for arbitrary pooling functions, for 2D inputs.
Assumed Density Filtering (ADF) version of the abstract Keras
Pooling2Dlayer.This class only exists for code reuse. It will never be an exposed API.
- Parameters
- pool_function
callable() The pooling function to apply, e.g.
tf.nn.max_pool2d.- pool_size
intortupleofint 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.- 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_function
-
call(self, inputs)¶
-
compute_output_shape(self, input_shape)¶
-
get_config(self)¶