And welcome back to 7.5 which is about pooling This is the next sequence of leads in our CNN so far
we've dealt with convolutional nearly the convolution part and real you know let's look at pulling all
those Monas subsampling spooling as I just said assaults and then a subsampling or downsampling is a
simple process where we reduce the size or dimensionality of the future map.
The purpose of this reductionists reduced number of parameters that we need to train whilst retaining
most of the important features and information in the image.
They are basically tree types of pooling we can apply.
There are actually some Wolper does take a look at these Tree Man types that are used.
So here's an example of Max pooling.
Imagine this is the really outputs from all this input output here was reproduced from the real real
layer.
So you can imagine these values at the zeros here were actually negative values.
So Max bhool basically uses a two by two Kial here we can define the screen size anything we want just
like we did with the straight and of the kernels we used in the convolutional Liya and basically using
a two by two.
It splits up into two by two two by two two by two by two grid.
So what it does Max beling takes it massively out of each tutelary for 167 2:41 and 235 and puts them
into this block here.
So this is what we call downsampling or subsampling.
Basically we have sort of like compressed the image here and retain the most Max important features
actually.
Let's go back to the previous slide and previously.
We mentioned average and sampling.
Now as you can imagine average and sampling would just simply be the average of these values here here
here here and sampling would just be the sum of these values.
So it's also a way we can use pooling.
However in majority of convolutional neural nets we always use maximally.
So this is only so far just to do a recap.
We have an input image with our key and all that is being slid across this image producing multiple
different filters here.
All of it seems much of the same size as the input image and that's because of zero padding.
Then we have a real output which basically is the same size up of matrix as this except all the negative
values into zeros.
And then we have the subsampling are pulling away a lot downsampling which basically reduces this image.
This Sorry this matrix by half 14 by 14 because as you can see using a two by two we have four by four
and we get a two by two and that's still 12 filters.
However they have not been downsampled.
So let's move on now.
So let's talk a bit more about pooling typically pooling is done using two by two windows with a straight
of two and no padding applied.
That's how we actually get this four by four here.
It takes a two by two jump to make two jump and blah blah blah.
So for smaller and put images or larger images we can use larger pools.
Or smaller pools whichever you want to do and using the above settings pooling has the effect of reducing
dimensionality width and height.
Those are the only two dimensions we have.
We reduce the of the previous layer by half.
And to us removing tree quarter or 75 percent of the activations seen in the previously
so keep moving on.
This makes our model more invariant to small or minor transformations or distortions no input image.
Since we're now averaging or taking to max or put from a small area of an image what this actually means
is that we're instead of looking at specific pixels here in an image because we're actually dwindling
sample and looking at a max in an area we sort of add some sort of variance or spatial variance too
awful to say.
So if filters on super specific to certain areas and I remember they being slid across the image.
So imagine this filter have been Slackware's image looking for a specific edge or whatever it can actually
add some invariants Now to it.
So this actually increases do basically the ability of all convolutional model to generalize to information
is never seen before.
So now let's move on to what is kind of to finally the awesomely as in-between of you discussed them
later on.
But for now seeing is of course to CNN and this is the last layer to fully connected.
FCPA.