AdaptiveMaxPooling3D classkeras.layers.AdaptiveMaxPooling3D(output_size, data_format=None, **kwargs)
Adaptive max pooling operation for 3D volumetric data.
This layer applies an adaptive max pooling operation, which pools the
input such that the output has a target spatial size specified by
output_size, regardless of the input spatial size. The kernel size
and stride are automatically computed to achieve the target output size.
Arguments
"channels_last" or "channels_first".
"channels_last" corresponds to inputs with shape
(batch, depth, height, width, channels).
"channels_first" corresponds to inputs with shape
(batch, channels, depth, height, width).
Defaults to the value found in your Keras config file at
~/.keras/keras.json. If never set, "channels_last" is used.Input shape
data_format="channels_last": 5D tensor
(batch_size, depth, height, width, channels)data_format="channels_first": 5D tensor
(batch_size, channels, depth, height, width)Output shape
data_format="channels_last":
(batch_size, output_depth, output_height, output_width, channels)data_format="channels_first":
(batch_size, channels, output_depth, output_height, output_width)Examples
import numpy as np input_vol = np.random.rand(1, 32, 32, 32, 3) layer = AdaptiveMaxPooling3D(output_size=16) output_vol = layer(input_vol) output_vol.shape (1, 16, 16, 16, 3)