Pool data to average values over spatial dimensions
The average pooling operation performs downsampling by dividing the input into pooling regions and computing the average value of each region.
The avgpool
function applies the average 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 average pooling within a layerGraph
object
or Layer
array, use
one of the following layers:
applies the average pooling operation to the formatted dlY
= avgpool(dlX
,poolsize
)dlarray
object
dlX
. The function downsamples the input by dividing it into regions
defined by poolsize
and calculating the average 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.
applies the average pooling operation to the unformatted dlY
= avgpool(___,'DataFormat',FMT)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 average pooling with format 'SSCB'
(spatial, spatial,
channel, batch).
specifies options using one or more name-value pair arguments. For example,
dlY
= avgpool(___,Name,Value
)'PoolFormat','T'
specifies a pooling region for 1-D pooling with format
'T'
(time).
dlarray
| dlconv
| dlfeval
| dlgradient
| maxpool