Calculating the Number of Parameters of a 2D CNN Layer How can I calculate the number of parameters for a 2D CNN layer?
I usually use the equation: $output \ width= ((W-F+2*P )/S)+1 = (x)$
The same answer will be valid for the output height considering that they have the same dimension. So the output dimension will be (x,x).
However, what if I want to calculate the number of parameters for a 2D CNN layer with filter size 5x5, input channel/depth = 3, and output channel or depth of 8?
When we say the filter size if 5x5 it is for an image with 1 input channel, for three the filter size is 5x5x3 (but at a lot of places this additional info is skipped to make things easy to understand). When you apply a kernel of 5x5x3 to an image the output is just one channel. To get an output of 8 channels you need 8 such kernels. In that case, the number of parameters would be 5x5x3x8.