This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

maxUnpooling2dLayer

Max unpooling layer

Description

A max unpooling layer unpools the output of a max pooling layer.

Creation

Syntax

layer = maxUnpooling2dLayer
layer = maxUnpooling2dLayer('Name',name)

Description

example

layer = maxUnpooling2dLayer creates a max unpooling layer.

example

layer = maxUnpooling2dLayer('Name',name) sets the Name property. To create a network containing a max unpooling layer you must specify a layer name.

Properties

expand all

Layer name, specified as a character vector or a string scalar. To include a layer in a layer graph, you must specify a nonempty unique layer name. If you train a series network with the layer and Name is set to '', then the software automatically assigns a name to the layer at training time.

Data Types: char | string

Number of inputs of the layer.

There are three inputs to this layer:

  • 'in' — Input feature map to unpool.

  • 'indices' — Indices of the maximum value in each pooled region. This is output by the max pooling layer.

  • 'size' — Output size of unpooled feature map. This is output by the max pooling layer.

Use the input names when connecting or disconnecting the max unpooling layer to other layers using connectLayers or disconnectLayers.

Data Types: double

Input names of the layer.

There are three inputs to this layer:

  • 'in' — Input feature map to unpool.

  • 'indices' — Indices of the maximum value in each pooled region. This is output by the max pooling layer.

  • 'size' — Output size of unpooled feature map. This is output by the max pooling layer.

Use the input names when connecting or disconnecting the max unpooling layer to other layers using connectLayers or disconnectLayers.

Data Types: cell

Number of outputs of the layer. This layer has a single output only.

Data Types: double

Output names of the layer. This layer has a single output only.

Data Types: cell

Examples

collapse all

Create a max unpooling layer that unpools the output of a max pooling layer.

layer = maxUnpooling2dLayer
layer = 
  MaxUnpooling2DLayer with properties:

          Name: ''
     NumInputs: 3
    InputNames: {'in'  'indices'  'size'}

Create a max pooling layer, and set the 'HasUnpoolingOutputs' property as true. This property gives the max pooling layer two additional outputs,'indices' and 'size', which enables unpooling the layer. Also create a max unpooling layer.

layers = [
    maxPooling2dLayer(2,'Stride',2,'Name','mpool','HasUnpoolingOutputs',true)
    maxUnpooling2dLayer('Name','unpool');
]
layers = 
  2x1 Layer array with layers:

     1   'mpool'    Max Pooling     2x2 max pooling with stride [2  2] and padding [0  0  0  0]
     2   'unpool'   Max Unpooling   Max Unpooling

Sequentially connect layers by adding them to a layerGraph. This step connects the 'out' output of the max pooling layer to the 'in' input of the max unpooling layer.

lgraph = layerGraph(layers)
lgraph = 
  LayerGraph with properties:

         Layers: [2x1 nnet.cnn.layer.Layer]
    Connections: [1x2 table]

Unpool the output of the max pooling layer, by connecting the max pooling layer outputs to the max unpooling layer inputs.

lgraph = connectLayers(lgraph,'mpool/indices','unpool/indices');
lgraph = connectLayers(lgraph,'mpool/size','unpool/size');

Introduced in R2017b