‫Now, one of the problems that originate with large stride is that we may not be able to cover the
‫entire image.
‫For example let us try to cover this image with a five by five window moving with a stride
‫of three.
‫So the first neuron covers these first twenty five pixels.
‫Now, in the next stride, we will cover these next twenty five pixels.
‫So we have a stride of three after the fourth pixel.
‫We count another twenty five pixels and so on.
‫At this point where are neuron is seeing these 25 pixels.
‫Now, in the next stride, we do not have 25 pixels.
‫We will be out of pixel columns which can be covered.
‫So if I take next stride, there are only 20 pixels available and not 25.
‫This is a problem because we want uniformity.
‫That is each neuron should have same receptive field of 25 pixels.
‫In this situation, we have two options.
‫First option is to ignore these extra pixels at the border.
‫So since we cannot cover the last two pixel columns, we leave out one pixel column from left and one
‫pixel column on the right.
‫So instead of a 16 by 16 image, we will consider only a 14 by 14 image, one line of pixel remove from
‫all the sides.
‫This 14 by 14 image can be covered with a five by five window.
‫And a stride of three.
‫This particular option.
‫It's called Valid padding.
‫Which actually means that we are not using any padding.
‫And that we only use valid window locations and ignore the extra pixels at the border.
‫Second option is adding extra rows and columns of dummy pixels or blank pixels.
‫For example, here we add one more layer of pixels.
‫We can then move forward with a stride of three.
‫And the last neutron will also have a view field of twenty five pixels twenty from the original image
‫and five of our artificially generated blank pixels.
‫This type of padding is called same padding, which means pad in such a way so as to have an output
‫which can be covered by a window of same width and height.
‫By default, padding arguments in our software are set valid if you think the border of your
‫image stores important information in those scenarios only we will change this parameter to same
‫valid works well.
‫Here is the definition of two arguments that we have covered.
‫First, it stride, stride denotes how many steps we take in each step of convolution.
‫So in the first step, that is our first neuron is looking at this red rectangle.
‫And the second neuron is looking at this blue rectangle.
‫Then we have a stride of two.
‫We can specify both horizontal and vertical strides separately.
‫By default, stride value is set at one.
‫The second concept that we discussed is of padding.
‫Padding is the process of adding zeros to the input image to maintain the dimension of output as an
‫input.
‫If we decide to ignore the border values, which could not be covered due to our large stride, in that
‫case, we are not using any padding for which the argument is valid padding.
‫If we are adding additional black pixels so that our window can cover the border pixels, also in that
‫scenario, we are using same padding.
‫So these are the two arguments that we will need to specify when we train our convolutional layer.