Hey.
So now let's take a look at putting, which allows us to manipulate the feature map size as we progress
through the convolutional neural network, which you'll see shortly.
So remember this lesson?
Remember when we have an image image of the size five by five, and then we performed a convolution
with a tree by tree filter.
It gives us a tree by tree up.
But I remember there was a formula we can calculate the output size by and notice the important thing
that the output produced is smaller than the input.
Remember, this is five by five.
And this is tree by tree.
Is that something that we want?
Is that desirable?
Well, think about this in almost all convolutional neural networks.
There's a sequence of convolutions like in a chain, and you can imagine this chin or sequence of convolutional
convolution blocks.
They will actually decrease the image size if you map size as it progresses through the network.
And that's not always desirable.
In fact, in most cases, that's not desirable.
These are the blocks completion blocks in this example here.
So the week we can see that consecutive convolution list keeps shrinking the output.
But is there a way we can preserve our image size?
What if we took the image this five by five image, but we potted it with zeros in all dimensions so
you can see as a zero on top at a right, at the bottom and on the left.
This now gives us a seven by seven matrix.
Interesting.
So what if we performed the compilation on this and you can see.
Keep going, keep going, keep going and move along.
We are going to produce a feature map size that is No.
Five by five.
Now what else was five five five?
Oh, input image was five by five.
You can see it here.
That's the pink region here.
And you can see what a formula it works out to be.
Seven.
Minus three.
The feature map the filter size sorry plus one, which is five.
So this is a way we can use something called putting, which is simply just putting the input image
with zeros around it to preserve the image size.
So why do we use padding?
I mean, as I said, it's it's not always desirable to have the image shrink, but why is that so?
Well, for very deep networks and when we say very deep networks, deep networks store a lot of information
you can imagine, like how much filters and parameters and activations all stores.
So if you want to keep a very deep network for a very complex dataset, you want to you want to basically
use padding to preserve the image size or the feature map size as it progresses to the network.
And now there's also a second reason why we use padding.
Remember how we passed the convolution filter across the image?
Remove it from left to right.
Well, think about something with pixels at the edges.
They only get touched once or minimal less amount of times than the pixels in the middle.
That means they contribute less to the output of feature maps and that that means we're throwing away
information from them.
And that's not desirable.
However, we're putting because you can imagine this this image being padded with zeros all around the
sliding window.
No touches these edge pixels a lot more often, so it helps the neural network learn a more balanced
information as well.
So that concludes this chapter on padding.
Now let's move on to Stryde, which is a very simple concept.
So I'll see you in the next section.
Thank you.