How no of params is calculated in convolution layer?

Layer (type) Output Shape Param

conv2d_6 (Conv2D) (None, 26, 26, 32) 320

conv2d_7 (Conv2D) (None, 24, 24, 64) 18496

This is a part of model summary where input image is of shape (28,28,1). How the no of params is calculated here?

Hey @preetishvij, for input layer output will be (None, 28,28,1) Next layer will be conv2d(32 filters, 3*3 filter size).

now to calculate number of parameters = no.of filters * filter_size * no of channels in previous layer + no of filters.

In last we added no.of filters for the bias term.

So total parameters in conv2d = 3233*1(1= no. of channels in previous layer) + 32 = 320.

Also applyting this formula of next convultion layer = 64 * (3*3) * (32) ( here 32 is no. of channels in previous layer) + 64 = 18496.

HOpe this resolved your doubt.
Plz mark it as resolved in my doubts section. :blush:

1 Like