TransposedConv2d
Transposed Convolution (Deconvolution) layer.
Transposed convolution is used for upsampling, essentially performing the reverse operation of convolution. It's commonly used in:
Generative models (GANs, VAEs)
Semantic segmentation (decoder networks)
Super-resolution networks
Any architecture requiring learned upsampling
Despite sometimes being called "deconvolution", it doesn't truly invert the convolution operation, but rather learns an upsampling transformation.
The transposed convolution increases the spatial dimensions of the input, making it useful for tasks that need to go from low-resolution feature maps to higher-resolution outputs.
Parameters
Number of input channels
Number of output channels/filters
Size of the convolving kernel (height, width)
Stride of the transposed convolution (default: 1, 1)
Padding added to all sides of the input (default: 0, 0)
Additional padding added to one side of output shape (default: 0, 0)
Spacing between kernel elements (default: 1, 1)
Number of groups for grouped transposed convolution (default: 1)
Whether to add a learnable bias to the output (default: true)
Name of the module
Initial weights tensor
Initial bias tensor (if bias is true)
Constructors
Types
Properties
Functions
Checks if this is a simple 2x upsampling (stride == (2, 2)).
Checks if this is a standard transposed convolution (no dilation, no groups).
Returns the total number of parameters in this layer.
Returns information about the transposed convolution configuration.
Returns the upsampling factor based on stride.