10

I was following andrew-ng coursera course on deep learning and there's a question that has been asked there which I couldn't figure out the answer for?

Suppose your input is a 300 by 300 color (RGB) image, and you use a convolutional layer with 100 filters that are each 5x5. How many parameters does this hidden layer have (including the bias parameters)?

  1. 2501

  2. 2600

  3. 7500

  4. 7600

Ethan
  • 1,657
  • 9
  • 25
  • 39
Anjith
  • 961
  • 2
  • 11
  • 20

4 Answers4

6

The right answer is the fourth.

From this, the formula to calculate the number of parameters in a convolutional layer is (n*m*l+1)*k with n = m = 5, k = 100, l = 3 and +1 for the bias.

Samuel Tap
  • 126
  • 3
5

As we have a RGB Image so our filter changes from 2D to 3D, whose dimension will be 5 * 5 * (no of channels from previous layer) = 5 * 5 * 3 = 75

Now we have 100 such filters, so total parameters increases to = 75 * 100 = 7500

Each filter has a constant bias associated with it, hence this introduces 100 biases for each filter or l00 more features

Total feature required = 5 * 5 * 3 * 100 + 100 = 7600

Tushar Gupta
  • 51
  • 1
  • 1
3

Based on the equation in the course:

enter image description here

  • Weights 5 * 5 * 3 * 100 = 7500
  • Bias 100

So total would be 7600.

Hongbo Miao
  • 131
  • 4
-1

Its (kernel_size=5*kernel_size+1(bias)) * n_channels=100

(5*5+1)*100 = 2600

hbyte
  • 1