DeconvolutionLayer

DeconvolutionLayer[n,sz]

represents a trainable deconvolutional net layer having n output channels and using kernels of size sz to compute the deconvolution.

DeconvolutionLayer[n,{s}]

represents a layer performing one-dimensional deconvolutions with kernels of size s.

DeconvolutionLayer[n,{h,w}]

represents a layer performing two-dimensional deconvolutions with kernels of size h×w.

DeconvolutionLayer[n,kernel,opts]

includes options for initial kernels and other parameters.

Details and Options

  • DeconvolutionLayer[][input] explicitly computes the output from applying the layer to input.
  • DeconvolutionLayer[][{input1,input2,}] explicitly computes outputs for each of the inputi.
  • The following optional parameters can be included:
  • "Biases"Automaticinitial vector of kernel biases
    "ChannelGroups"1number of channel groups
    InterleavingFalsethe position of the channel dimension
    LearningRateMultipliersAutomaticlearning rate multipliers for kernel weights and/or biases
    PaddingSize0amount of padding to remove from the output
    "Stride"1convolution step size to use
    "Weights"Automaticinitial matrix of kernel weights
  • The settings for PaddingSize and "Stride" can be of the following forms:
  • nuse the value n for all dimensions
    {,ni,}use the value ni for the i^(th) dimension
  • By setting "GroupNumber"g, the m input channels and n output channels are split into g groups of m/g and n/g channels, respectively, where m and n are required to be divisible by g. Separate deconvolutions are performed connecting the i^(th) group of input channels with the i^(th) group of output channels, and results are concatenated in the output. Each input/output group pair is connected by n/g×m/g deconvolution, so setting "GroupNumber"g effectively reduces the number of distinct deconvolutions from n×m to n×m/g.
  • With Automatic settings, weights and biases are added automatically when NetInitialize or NetTrain is used.
  • The setting "Biases"->None specifies that no biases should be used.
  • With the setting InterleavingFalse, the channel dimension is taken to be the first dimension of the input and output arrays.
  • With the setting InterleavingTrue, the channel dimension is taken to be the last dimension of the input and output arrays.
  • If weights and biases have been added, DeconvolutionLayer[][input] explicitly computes the output from applying the layer.
  • DeconvolutionLayer[][{input1,input2,}] explicitly computes outputs for each of the inputi.
  • When given a NumericArray as input, the output will be a NumericArray.
  • NetExtract can be used to extract weights and biases from a DeconvolutionLayer object.
  • DeconvolutionLayer is typically used inside NetChain, NetGraph, etc.
  • DeconvolutionLayer exposes the following ports for use in NetGraph etc.:
  • "Input"a rank-3 array
    "Output"a rank-3 array
  • 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 DeconvolutionLayer.
  • Given an input array of dimensions d1×d2×d3, the output array will be of dimensions ××, where the channel dimension =n and the sizes d2 and d3 are transformed according to =s(di-1)+k-2p, where is the padding size, is the kernel size, and is the stride size for each dimension.
  • Options[DeconvolutionLayer] gives the list of default options to construct the layer. Options[DeconvolutionLayer[]] gives the list of default options to evaluate the layer on some data.
  • Information[DeconvolutionLayer[]] gives a report about the layer.
  • Information[DeconvolutionLayer[],prop] gives the value of the property prop of DeconvolutionLayer[]. Possible properties are the same as for NetGraph.

Examples

open allclose all

Basic Examples  (3)

Create a DeconvolutionLayer with five output channels and a 2×2 kernel size:

Create a randomly initialized DeconvolutionLayer with the input dimensions specified:

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

Create a randomly initialized DeconvolutionLayer that takes in an image and produces an image:

Apply the layer to an image:

Thread the layer over a batch of inputs:

Options  (5)

"Biases"  (1)

Create a randomly initialized DeconvolutionLayer without biases:

No biases are present:

Interleaving  (1)

Create a DeconvolutionLayer with InterleavingFalse and one input channel:

Create a DeconvolutionLayer with InterleavingTrue and one input channel:

PaddingSize  (1)

Use padding to make the output dimensions equivalent to the input dimensions:

"Stride"  (1)

Use a larger stride to increase the dimension of the output:

"Weights"  (1)

Create a deconvolution layer with specified weights and no biases:

Evaluate this layer on data:

Properties & Relations  (1)

The following function computes the size of the non-channel dimensions , given the input size and parameters:

The output size of an input of size {256,120}, a kernel size of 3, a stride of 2, and a padding size of 2:

Introduced in 2016
 (11.0)
 |
Updated in 2020
 (12.1)