As you might remember, model has three parts.
The model architecture, the model configuration and fitting the model first will define the model architecture.
I've shown you the architecture that we are creating for this problem.
After the input layer, the first layer that we will have is a convolutional to deliver
in this layer.
We are going to have 32 feature maps.
So we are going to use 32 filters the city first parameter each week that has a window size or a receptive
field of three by three pixels.
So the first neuron in this convolutional layer will look at only three and two three.
That is a square of nine pixels in the input image.
So that is the kernel size or the window dimensions of our feet that the activation function for our
convolutional layer.
We are using here is Relu
and the input shape of the images is 28 by 28 and one.
So these two are the height and weight of images.
And this is the channel.
Next it is a max pooling layer.
Max pulling leered has a pool size of two by two.
That is the window of neurons in the previous layer will be of two and two two pixels out of these four
pixels, whichever values maximum will be taken as the output value of the cell in max willingly.
By default, this layer will have a straight off to this convolutional layer.
We'll have a by default straight value one if you want to change these trade.
Also, you can add additional barometer of straight is equal to two or three, whatever you want to
set it to in the pulling layer, the default value status two.
So this pulling layer will reduce the dimensions by two in both directions horizontally and vertically,
which means that the output layer will have one fourth of the neurons as compared to the convolutional.
So I separated this section.
This is the convolutional section from our normal neural network.
The output of this convolutional section is going into our normal neural network.
So these are the next layers.
You could have listed all the layers in one go only, but just to make it clear that this part is the
convolutional part.
And this is where we do normal neural network processing.
I have separated these two.
So the output of this layer will be three dimensional.
We need to flatten it as a layer.
So we use a flatten layer.
The output of this flattened layer goes into a dense layer of 300 neurons with activation function relu.
The output of these three under neutrons goes in to next to the layer of under neurons.
These also have activation function below.
Then the last layer, that is the output neuron layer has only 10 output neurons with activation function
softmax.
This part is exactly same.
So this structure of the model is exactly same as we discussed last time.
So let's run these two.
Now, if you look at your model,
we have created a sequential model.
First layer is a convolutional to deliver.
Its output ship is 26 by 26 input, the image was 28 by 28.
But because by default, padding is set to valid.
That is no additional padding is done.
The additional boundry pixels were removed in the convolutional.
So Vendig receptive field of convolutional layer was moving to the input layer.
There were some pixels which could not be covered.
So those were ignored.
So one pixel from all of the boundaries were removed.
That is why this ship is now 26 by 26 instead of 28 by 28.
These 32 are defeater maps because we had 32 printers.
Max, pulling Pullinger reduces these dimensions by two and we still have 32 feature maps.
Then we have a flattened layer, then dense layer with 300 neurons, then another dense layer with hundred
neurons.
And lastly, the output layer retender.
Don't the total number of parameters to be predicted is one point six million in the next lecture.
When we remove the pooling layer or we try to add additional convolutional layer, we will see how this
number of parameters changes and it will give us a hint of how pulling layer reduces the computational
load on our system.