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" Automatic initial vector of kernel biases "ChannelGroups" 1 number of channel groups "Interleaving" False the position of the channel dimension "PaddingSize" 0 amount of padding to remove from the output "Stride" 1 convolution step size to use "Weights" Automatic initial matrix of kernel weights - The settings for "PaddingSize" and "Stride" can be of the following forms:
-
n use the value n for all dimensions {…,ni,…} use the value ni for the i 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
group of input channels with the i
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 allBasic 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: