DeconvolutionLayer

DeconvolutionLayer[n,sz]

represents a trainable 2D deconvolutional net layer that has n output channels and uses kernels of size {sz,sz} to compute the deconvolution.

DeconvolutionLayer[n,{h,w}]

uses kernels of size {h,w}.

DeconvolutionLayer[n,{h,w},opts]

includes options for initial kernels and other parameters.

Details and Options

  • The following optional parameters can be included:
  • "Biases"Automaticinitial vector of kernel biases
    "PaddingSize"0amount of padding to remove from the output
    "Stride"1convolution step size to use
    "Weights"Automaticinitial matrix of kernel weights
  • 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.
  • 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.
  • 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 numerical tensor
    "Output"a rank-3 numerical tensor
  • 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 tensor of dimensions d1×d2×d3, the output tensor 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 allclose 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  (4)

Properties & Relations  (1)

See Also

ConvolutionLayer  NetChain  NetGraph  NetInitialize  NetTrain  NetExtract

Introduced in 2016
(11.0)