Calculate the output shape produced by a transposed (deconvolution) layer.
Transposed convolution (deconvolution) upsamples feature maps. Its output size is (input-1)×stride - 2×padding + kernel_size + output_padding. It is used in decoder networks, GANs for image generation, and semantic segmentation for upsampling to full resolution.
ConvTranspose Output
output = (input - 1) × stride - 2 × padding + kernel_size + output_padding
Technically no — true deconvolution inverts a convolution. Transposed convolution is the gradient operation of convolution and is commonly (if imprecisely) called deconvolution in deep learning.
When stride doesn't evenly divide kernel size, overlapping regions receive unequal contributions, creating a checkerboard pattern. Using kernel_size divisible by stride (e.g., 4×4 with stride 2) helps.