Pool data to maximum value
The maximum pooling operation performs downsampling by dividing the input into pooling regions and computing the maximum value of each region.
The maxpool
function applies the maximum pooling operation to dlarray
data.
Using dlarray
objects makes working with high
dimensional data easier by allowing you to label the dimensions. For example, you can label
which dimensions correspond to spatial, time, channel, and batch dimensions using the
'S'
, 'T'
, 'C'
, and
'B'
labels, respectively. For unspecified and other dimensions, use the
'U'
label. For dlarray
object functions that operate
over particular dimensions, you can specify the dimension labels by formatting the
dlarray
object directly, or by using the 'DataFormat'
option.
Note
To apply maximum pooling within a layerGraph
object
or Layer
array, use
one of the following layers:
applies the maximum pooling operation to the formatted dlY
= maxpool(dlX
,poolsize
)dlarray
object
dlX
. The function downsamples the input by dividing it into regions
defined by poolsize
and calculating the maximum value of the data in
each region. The output dlY
is a formatted dlarray
with the same dimension labels as dlX
.
The function, by default, pools over up to three dimensions of
dlX
labeled 'S'
(spatial). To pool over dimensions
labeled 'T'
(time), specify a pooling region with a 'T'
dimension using the 'PoolFormat'
option.
For unformatted input data, use the 'DataFormat'
option.
___ = maxpool(___,'DataFormat',FMT)
applies
the maximum pooling operation to the unformatted dlarray
object
dlX
with format specified by FMT
using any of the
previous syntaxes. The output dlY
is an unformatted
dlarray
object with dimensions in the same order as
dlX
. For example, 'DataFormat','SSCB'
specifies
data for 2-D maximum pooling with format 'SSCB'
(spatial, spatial,
channel, batch).
___ = maxpool(___,
specifies options using one or more name-value pair arguments. For example,
Name,Value
)'PoolFormat','T'
specifies a pooling region for 1-D pooling with format
'T'
(time).