Stride is the number of input positions a convolution kernel advances after producing one output. With stride 1, the kernel stops at successive elements; with stride 2, it stops at every other element. Larger strides therefore sample fewer kernel positions and usually reduce output size. section 10.1 section 10.8
For a 1D input of size n, kernel size k, stride s, and valid padding, after m shifts the kernel's right edge is ms + (k − 1), which must not exceed n − 1. Each valid position emits one value, so output size follows from the largest permissible m. With p zeros padded on each side, replace n by n + 2p; apply the calculation independently along each dimension. section 10.2 section 10.1
Stride 1 versus stride 2
A size-3 averaging kernel over a length-7 array with valid padding produces outputs from overlapping windows. At stride 1, the window advances one element at a time; at stride 2, it advances two, visiting every other start position and producing fewer outputs. section 10.1
Compare the stride-2 slide stops with the stride-1 case to see how skipping start positions shortens the output. section 10.1
Stride generalizes to spatial and spatio-temporal convolution. A 3D stride vector [sT, sH, sW] sets the stepping interval through time, height, and width; every slide stop yields one output point. Transposed convolution reverses the output-size relationship: o′ = (n′ − 1)s + k − 2p. section 10.4 section 10.5.2
In PyTorch, stride is a convolution-layer parameter alongside kernel size and padding. `torch.nn.Conv1d` and `torch.nn.functional.conv1d` accept it directly. Pooling uses the same geometric idea: a 2 × 2 filter with stride 2 makes an output feature map half the input size. section 10.1.4 section 10.7







