For an input image of size 128X128X3, if the first 2D convolutional layer has 64 filters of size 2X2x3 and stride 2 with no padding. What is the total number of learnable parameters(bias included) in the layer?
Answers
Answer:
If you’ve been playing with CNN’s it is common to encounter a summary of parameters as seen in the above image. We all know it is easy to calculate the activation size, considering it’s merely the product of width, height and the number of channels in that layer.
For example, as shown in the above image from coursera, the input layer’s shape is (32, 32, 3), the activation size of that layer is 32 * 32 * 3 = 3072. The same holds good if you want to calculate the activation shape of any other layer. Say, we want to calculate the activation size for CONV2. All we have to do is just multiply (10,10,16) , i.e 10*10*16 = 1600, and you’re done calculating the activation size.
However, what sometimes may get tricky, is the approach to calculate the number of parameters in a given layer. With that said, here are some simple ideas to keep in my mind to do the same.