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
    "Interleaving"Falsethe position of the channel dimension
    "PaddingSize"0amount 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 "Interleaving"->False, the channel dimension is taken to be the first dimension of the input and output arrays.
  • With the setting "Interleaving"->True, 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.

Examples

open all close all

Basic Examples  (3)

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

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

Create a randomly initialized DeconvolutionLayer 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]//MatrixForm=

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

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

Apply the layer to an image:

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

Thread the layer over a batch of inputs:

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

Options  (5)

Properties & Relations  (1)

Introduced in 2016
(11.0)
|
Updated in 2019
(12.0)