In order to create our convolutional neural network, we're just going to make use of this sequential
API, which we had built previously, and then we'll define the input layer.
So here we have this input shape to 24 lets we add define in size actually.
So we have M size, that's it by M size by three.
We could also define a number of channels, but let's just let it to be equal to three.
Then from here we have the normal laser and then we have this column to the layer right here.
So we have this arguments which are default.
So we'll then bother to check on this.
We will take this off, take this off, and that's fine.
So we'll have this.
There we go.
We have our come to DX will come to D which we copy or rather we cut that off and then we put this after
the input layer right here.
So there we go, We have our input layer.
We want six filters and then we can size of five.
So that's it.
Our stride, we could take this to be equal one.
There we go.
Pattern is valid, so that's what we expect.
And then just here we have our activation.
So we have activation, we could see sigmoid, we have the sigmoid activation since we're replicating
the rail loop or rather the net architecture.
So there we go, we have the sigmoid and that's our come to D from the continuity.
We have a max pooling layer.
Let's take this off, let's take this dense layers off from this curve to D, We have the max pull and
layer.
Now what we could do is we could just simply import all this.
So let's go ahead and say in part the come to the max pull to and the dense layer coming back to our
documentation we could check out on the max pull two D So there we go we have Max pull to DD.
We'll specify the pull size, which is equal to and then the number of stripes equal to pattern is valid
and data format.
We're not going to specify that.
So we have our MAX pull to DD and then this pull in size with the stripes.
We copy that.
We actually don't know the stride of two, so we replace that.
We have a straight of two.
The next step is this one right here, similar to what we had seen previously with a difference that
now we have 16 number of filters and so we could simply copy this and then paste this out right here
we have come to the max, pull two DD Now come to the max two.
DD And then here we have 16 number of filters.
The pattern is valid activation sigmoid.
Then this next max pull to DD is still the same as what we had previously.
And so we move on to the flattened layer.
We add this here we have flatten, there we go and we run that.
So while that's running, we just simply come right here and then add that flattened layer.
So we have this flattened layer which is in charge of flooding this or converting this into this one.
The output from this flatten, we now have a dense layer, which is what we've seen already.
So we just have to put this dense layer here, stick this like this, and there we go.
So we have our dense layer and then the activation is sigmoid.
So we're respecting the activation using the low net paper.
Then we have this here, take 1000 and then we have that, we add another dense layer and this other
dense layer.
Now we'll make sure that as we create this final dense layer right here, it has an output of two neurons
since we are dealing with a binary classification problem.
So that's fine.
Take this here and then run our model.
We have it.
That input layer is not defined.
So let's simply add that here we have the input layer, we run that and then check that out again.
There we go.
We have this input layer which we run, which we add, and then we run this.
Now everything is fine.
So that's it.
We have 45 million parameters and no non trainable parameter.
Notice how the this dense layer here is responsible for a huge percentage of our parameters.
So we could reduce this.
Let's take this to 100 and then this to like ten.
Let's run that again.
And there we go.
We have a smaller model this time around.
A point and notice is not.
Parameters which we pre calculated here.
Yea, we have 456 and we have 2460.
And we'll see how we get exactly this number of values here for the dense layer.
It's quite obvious as we just have 100 times ten plus the ten biases giving us 100 times 10 to 1000
plus ten giving us 1010.
And then here we have ten times two, 20, 20, plus two biases giving us 22.
It should also be noted that there was a slight error here, as we don't have.
Like with this, we have five by five by three, but there is five by five by six since we have the
input number of channels equals six.
So this means this is five by five by six and here is five, by five by three, All this five by five
by three and all this five by five by six.
And if you take five by five by six and multiply it 16 times, you should have 2416.
It should be noted that here we're trying to replicate the learned architecture.
And this is in no way the state of the art kinds of models we use today.
So in the section on the corrective measures, we are going to use even better models.
For now, let's just work with this.