About the convolutional layer

Asked 2 years ago, Updated 2 years ago, 29 views

https://stackoverflow.com/questions/42786717/how-to-calculate-the-number-of-parameters-for-convolutional-neural-network

I have a question because there was something I didn't understand while looking at the website above.

#name size parameters
--- -------- ------------------------- ------------------------
0 input 1x28x280
1 conv2d1(28-(5-1)=24->32x24x24(5*5*1+1)*32=832
2 maxpool 132x12x120
3 conv2d2(12-(3-1)=10->32x10x10(3*3*32+1)*32=9'248
4 maxpool 232x5x50
5dense256 (32*5*5+1)*256 = 205'056
6 output 10 (256+1)*10 = 2'570

When you have a CNN model like the one above, you have 32 filters in the first conv2d1 layer, right?
This was understood to be 32 different 5*5 weight matrices.

By biting the pooling layer, you can see that the output is 32*12*12.
(like 32 12*12 images)

However, if I apply 32 weight matrix filters to this output in conv2d2, it will be 32 times larger, so is that correct?

Thank you for your cooperation.

python

2022-09-30 21:42

1 Answers

The image you get from the convolutional layer says
It looks like there are 32 12*12 images. More conceptually, a single image with a size of 12x12 and 32 channels is closer.
I think the following website will be helpful.
https://qiita.com/icoxfog417/items/5aa1b3f87bb294f84bac


Expressions for calculating the number of parameters in the conv2d2 layer are provided. There are 32 kernels with 3x3 size and 32 channels, so add one layer of bias to
(3*3*32+1)*32=9'248
This is what it says.


2022-09-30 21:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.