Issue related to mapping of filter and need to know how to calculate total number of parameters?

After second line we are going to have kind of a dense layer of shape 26X26X32 and also it can be seen in model summary

Now notice the size of filter while adding second layer it is 3X3 and the layer is 3D. So how is mapping being done right here?

And the last doubt is there’s a feature comes out in model.summary() named Param. So, how can I calculate it manually?

I didn’t get this doubt. Can you please be more brief about this.

When your print model.summary()
It will show a table kind of structure which you can use to get an understanding about your model.
In this table , on the right side , you might can see some big digits/numbers , these numbers are the number of parameters/calculating operations going to be made in each corresponding layers.
So , you can just add them up and get the final number of params.

I hope this helps.

The filter shape should always be equal to the input
In the First layer we have input of (28X28X1) which is 3D and the filter shape is 3X3 which is 2D. So why there’s no error raising.
Next doubt is when layer 1 produces output it goes to second layer. The shape of output will be 26X26X32 here 32 is the number of filters applied previously. Now, the question is how a 2D filter will be applied over 3D image?

hey @Joy-Gupta-2763139277246091 ,
Actually when we say an image is 3D , it means it is a combination of 3 different 2D images.
Like RGB , it means , we have 3 2D images in each R, G and B channels.
So , now you have a filter of 2x2 , mean a 2D filter and now you can see that it can be easily applied over a 2D image.
In this way the convolution works.

Number of Params at a particular layer means , the number of calculations/ operations to be made to get the current shape into new shape.
So, you just to need to find all the operations being made in a convolution layer , given some definite shapes , and using them you can easily calculate the number of params in that layer.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.