Padding

One way to maybe increase the dimensions to 4 x 4 would be to introduce padding.

Padding by 1, for example, just adds one full rectangle of zeros, as shown in the following screenshot:

And by doing that, we increase the dimension of the input images from 6 to 8, so now we have 8 x 8 x 3, and by applying the formula we'll have, for example, 8-3+1=6. Now, notice how it was increased from 4 x 4 to 6 x 6; the 6 x 6 of the output is equal to the original input image, which is the blue color in the input matrix. In the literature, this phenomenon is called the Same Convolution, so the same convolution refers to the fact that the output convolve matrix has the same dimensions as the original input image.

Now, to be 100% correct here, we need to fix a bit of this formula, because the input matrix dimensions are not 8 but 6. In order to introduce the padding, we'll add this term:

Here, 2*P is the padding. Let's try this new formula now:

We've learned how to increase the dimensions, although the convolution, by default, will decrease if we don't do anything like padding. There could be cases when we want to increase even more, and one way to do that is by introducing stride.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.186.219