PoolingLayer
PoolingLayer[sz]
represents a pooling net layer using kernels of size sz.
PoolingLayer[{w}]
represents a layer performing one-dimensional pooling with kernels of size w.
PoolingLayer[{h,w}]
represents a layer performing two-dimensional pooling with kernels of size h×w.
PoolingLayer[kernel,stride]
represents a layer that uses stride as the step size between kernel applications.
PoolingLayer[kernel,opts]
includes options for other pooling methods, padding and other parameters.
Details and Options
- PoolingLayer[n,…] represents a layer that, applied to an input tensor with c input channels and one or more spatial dimensions, performs c distinct pooling operations across the spatial dimensions to produce an output tensor with c channels. The channel dimension is taken to be the first dimension of the input and output tensors.
- PoolingLayer[n] is equivalent to PoolingLayer[n,1].
- The following optional parameters can be included:
-
"Dimensionality" Automatic number of spatial dimensions of the pooling "Function" Max aggregation function to use "PaddingSize" 0 amount of zero padding to apply to the input - The settings for kernel, stride, and "PaddingSize" can be of the following forms:
-
n use the value n for all dimensions {…,ni,…} use the value ni for the i
dimension - PoolingLayer[…][input] explicitly computes the output from applying the layer.
- PoolingLayer[…][{input1,input2,…}] explicitly computes outputs for each of the inputi.
- PoolingLayer is typically used inside NetChain, NetGraph, etc.
- NetExtract can be used to extract parameter values from a PoolingLayer object.
- PoolingLayer exposes the following ports for use in NetGraph etc.:
-
"Input" a matrix or rank-3 tensor "Output" a matrix or rank-3 tensor - Possible explicit settings for the "Function" option include:
-
Max the maximum is used Mean the mean value is used Total the sum of all values is used - When it cannot be inferred from other layers in a larger net, the option "Input"->{d1,…,dn} can be used to fix the input dimensions of PoolingLayer.
- Given an input tensor of dimensions d1×…×di×…, the output tensor will be of dimensions
×…×
×…, where the channel dimension remains unchanged (i.e. d1=
) and the sizes of spatial dimensions are transformed according to
, where
is the padding size,
is the kernel size, and
is the stride size for each dimension.
Examples
open allclose allBasic Examples (2)
Create a PoolingLayer with a kernel size of 5:
Create a one-dimensional PoolingLayer:
Scope (3)
Options (3)
Properties & Relations (2)
See Also
ConvolutionLayer BatchNormalizationLayer SpatialTransformationLayer AggregationLayer NetChain NetGraph NetTrain
Related Guides
Introduced in 2016
(11.0)
| Updated in 2017 (11.1)