What is “stride” in Convolutional Neural Network?

Ting-Hao Chen
Machine Learning Notes
2 min readNov 7, 2017

Stride is how far the filter moves in every step along one direction.

How does a computer read an image? Basically a computer read an image from left to right and from top to bottom. Therefore it starts from the top-left corner all the way to bottom-right corner. Moreover, it reads the image with a definite size. Image this scenario: A man is reading a newspaper by using magnifier. Every time the man could only read parts of the newspaper and the size of the magnifier decides how many words the man could read. Back to our discussion, the computer is taking a filter to read the image.

Photo credited to https://www.amazon.co.uk/Handheld-Magnifier-Magnifying-Reading-Jewelry/dp/B00MWKD2I8

Then we define how far the filter moves from one position to the next position by “stride”. Let’s look at an example. The red square is a filter. The computer is going to use this filter to scan the image.

If stride = 1, the filter will move one pixel.

If stride = 2, the filter will move two pixels.

--

--