Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

PoolingLayer

PoolingLayer[sz]
represents a 2D pooling net layer using kernels of size {sz,sz}.

PoolingLayer[{h,w}]
uses a kernel of size {h,w}.

PoolingLayer[{h,w},opts]
includes options for other pooling method parameters.

Details and OptionsDetails and Options

  • The following optional parameters can be included:
  • "Function"Maxaggregation function to use
    "PaddingSize"0amount of zero padding to apply to the input
    "Stride"1kernel step size to use
  • 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 rank-3 numerical tensor
    "Output"a rank-3 numerical tensor
  • Possible explicit settings for the "Function" option include:
  • Maxthe maximum is used
    Meanthe mean value is used
    Totalthe sum of all values is used
  • When it cannot be inferred from other layers in a larger net, the option "Input"->{d1,d2,d3} can be used to fix the input dimensions of PoolingLayer.
  • Given an input tensor of dimensions d1×d2×d3, the output tensor will be of dimensions 1×2×3 where the channel dimension is unchanged, 1=d1, and the sizes d2 and d3 are transformed according to i=Min[di+2p-k+s-1,di+2p-1]/s+1, where is the padding size, is the kernel size, and is the stride size for each dimension.

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Create a 3x3 pooling layer:

In[1]:=
Click for copyable input
Out[1]=

Create a pooling layer with the input dimensions specified:

In[1]:=
Click for copyable input
Out[1]=

Apply the layer to an input tensor to produce an output tensor:

In[2]:=
Click for copyable input
Out[2]=

Create a pooling layer that takes in an image and returns an image using a NetEncoder and NetDecoder:

In[1]:=
Click for copyable input
Out[1]=

Apply the pooling layer to an image:

In[2]:=
Click for copyable input
Out[2]=
Introduced in 2016
(11.0)