Course contentsShow
← Machine Learning and Deep Learning
Lesson 855 of 3,53820. Convolutional Neural Networks: FundamentalsFree lesson

Stride: Controlling Step Size

How stride determines how many pixels the filter moves at each step.

Stride: Controlling Step Size

What you'll learn: How stride determines how many pixels the convolution filter moves at each step as it slides across an image.

The Core Concept

When performing convolution, the filter (or kernel) doesn't have to move one pixel at a time. Stride is the parameter that controls how far the filter shifts with each step—both horizontally and vertically.

A stride of 1 means the filter moves one pixel at a time, computing an output value at nearly every possible position. This produces an output feature map that's close to the input size (depending on padding).

A stride of 2 means the filter jumps two pixels with each step, effectively skipping positions. This results in a smaller output feature map—roughly half the dimensions in each direction.

Analogy: Reading a Book

Think of reading every word in a book versus skipping every other word. With stride=1, you're reading (processing) every position carefully. With stride=2, you're jumping ahead, getting a quicker but coarser understanding of the content.

Why Stride Matters

  • Computational efficiency: Larger strides mean fewer operations and faster processing
  • Spatial downsampling: Stride > 1 reduces the spatial dimensions of feature maps, similar to pooling
  • Receptive field: Larger strides help the network "see" larger portions of the input more quickly in deeper layers

Stride works together with kernel size and padding to determine your output dimensions. Higher stride values trade spatial resolution for computational speed.

Key Takeaway: Stride controls how many pixels the convolution filter moves at each step—stride=1 slides smoothly, while stride>1 jumps positions, reducing output size and computation cost.