Concept

Strides in Transposed Convolution

In transposed convolution, strides determine the spatial arrangement of the intermediate results rather than the sliding movement of the kernel over the input. Specifically, a stride greater than 11 increases the spacing between the broadcasted elements in the intermediate tensor, which expands both the height and width of the final output. For instance, increasing the stride from 11 to 22 with a 2×22 \times 2 kernel places the generated values two pixels apart in the intermediate matrix. This expansion mechanism can be implemented by setting the stride parameter to stride=2 in PyTorch's nn.ConvTranspose2d or strides=2 in MXNet's nn.Conv2DTranspose.

# PyTorch tconv = nn.ConvTranspose2d(1, 1, kernel_size=2, stride=2, bias=False) tconv.weight.data = K tconv(X)
# MXNet tconv = nn.Conv2DTranspose(1, kernel_size=2, strides=2) tconv.initialize(init.Constant(K)) tconv(X)
Image 0

0

1

Updated 2026-05-21

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L