Let us continue.
Now.
Let us continue and right now we are going to add the sequential, which will combine all of our convolutional
areas together.
So this is guanciale is going to be assigned to a variable, we're going to call it classifier because
here we are creating excellent classifier and we're going to type sequential.
Like that, so now our classifier is ready to be stacked, the way to add layers of stacking is by simply
calling methods or functions on this classifier.
Now, again, those are all object oriented programming related concepts.
But you can get it from the context we are doing here.
If you want to add a layer of dry classifier, you just say classifier, dot, add.
OK.
And by that we are ready to add the layer we want.
So what is the properties of this and what do we want to add exactly in my case?
First layer is always the convolutional, right?
So we're going to second 2D and we need now to specify our filters and the resulting sites.
So let's say the result is 16 and we want to pass the filter.
Now the filter is three by three.
We have already talked about all of that in the theory section.
So we are creating a convolutional layer with a filter of three by three.
All right, what's next?
What else do I want?
After I have added my convolutional layer?
I want to add my input shape.
So input.
Shane, what is this now, when you pass an image to your convolutional network, the image sizes,
they should be unified.
This means maybe you have a thousand images.
Each is a different size.
It doesn't matter.
Your classifier is going to take it, scale it down so that all the images are on the same scale.
This is very important.
When you are dealing with CNN, you cannot have a variety of sizes being passed to you or DNN.
Otherwise it won't learn anything because the difference in sizes is going to make feature collection
is very hard task almost impossible.
So what we do here is simply specify the input shape.
Now, my input shape and the library, which is the Middle East, is a library that has all of the images
are greyscale.
OK, so let's say that I want a 28 by 28 images to be passed.
OK, and here I will type one.
One is because I have a grayscale now.
Grayscale is only one layer.
So the pixels you have, as you have learned for greyscale or for the black and white, every pixel
can take a value between zero to 255, let's say, if it's an eight bit image.
OK, so it's only actually one layer.
OK, only one layer.
One matrix is enough to determine the whole color of your image.
Right?
Every pixel you choose the value of it, which is between white and black.
This value is in between zero and 255 and that's it.
If I have a colored image, I would have to type three here.
Why?
Because I got image and specifically the AGB has three layers red, blue and green.
And every pixel has three values.
Right.
The value of the blue, the value of the red and the value of the green.
OK, so this is why we would need to type three because we have three mattresses and three layers,
but here we have only one, which is a grayscale image.
No, next my activation will be added here.
It's not a separate layer.
I'm going to add my activation inside the convolutions.
All I need to do is type activation.
And you can guess what type of activation I want to use here.
We have already talked about it and I just introduced it to you.
It's called the original, so my activator will be there.
OK, so far so good.
Right?
We have added our first layer.
That's amazing.
Now, what comes after convolution?
What comes is a pulling there.
Right?
So how do I pulling something classifier.
Ad and so I think a new layer.
What's the name of Meyler?
It's called Max Poulenc.
Max Poulenc, Tudi, now, what do I need to specify to this, Max?
Well, the most important thing is what is my polling filter right now to specify the polling filter?
I'm going to type all size.
And I'm going to be choosing to buy two.
All right, now, those values that I'm giving you are very realistic for this database.
Now, maybe if you have a larger image, maybe you could increase this to five.
But it's not really recommended that you go over five in the CNN.
So choose the three or five.
See which one learns better on your data.
OK.
I mean, don't confuse yourself with other values other than the EU, because the larger the convolutional
layer here filter is, the more complicated and the slower the learning is going to be.
So it's not really recommended for Linksys as well.
You can just stick to by two.
It should be more than enough.
All right.
That's amazing.
Now we have added our first layer.
Now, how about we add another layer?
So what you are going to do is we're going to add it like this.
And what we have now is to convolutional errors and to make spudding layers.
But we're going to change the number of filters here.
OK, so the number of filters here is going to be 32 and we're going to stick to the same size right
here.
Also, we don't need the input shape anymore because the input shape is only important.
And all the relative and the first convolutional layer.
Right, because where I am putting the image here, there is no passing of an image in order to scale
it or something.
Now, you might ask, why do I have 16 filters here, resulting filters and here I have 32 filters.
Well, the reason is the deeper you go, the more features that you are going to extract, as we have
seen, as we have seen in the theory section.
So here I am having 32 filters, each with a different value that are going to be scanning my image
through two filters will be scanning here.
Here, only 16 filters will be scanning my image, remembering that scanner that we have shown that
they have showed you.
So if I come here, you will see this is my filter and I am creating 32 one of them and letting them
scan the same image.
I'm doing this so that I can explain to you further, what is this 32 a number of mean or what is this
60 number means?
It is the number of these filters that I'm going to scan.
So I'm going to duplicate this 32 times.
Each will be given different values.
Now, with that propagation, the filter values will also change and they're going to learn features
from my image.
All right.
So we have added another convolutional layer.
Also, it's going to be Relu and the bullying is going to be the same two by two.
Now, next lecture, we're going to continue with the other layers.