# Counting Number of Parameters in Neural Networks [closed]

Note: This is an academics based problem.

So in a recent in-class quiz, we were asked that if we have an input layer consisting of 20 nodes along with 2 hidden layers (one of size 10 and the other of size 5), what will the total number of parameters in this network? How can we compute this?

Additionally, how do we know what shapes are they weights of? How can we determine which activation functions are suitable for such a neural network?

My idea was that (20*10) + (10*5) + (biases = 10+5) = 265. So 265 should be the number of parameters. For shapes/activation functions, from what I understand, it just depends on the data, no? Couldn't think of any way to directly predict it from this limited information

• What do you think the answer should be? – Akavall Dec 23 '19 at 0:56
• @Akavall My idea was that (20*10) + (10*5) + (biases = 10+5) = 265. So 265 should be the number of parameters. For shapes/activation functions, from what I understand, it just depends on the data, no? Couldn't think of any way to directly predict it from this limited information. – x89 Dec 23 '19 at 5:15
• I am not an expert, but as far as I can tell, there is not enough information in the question to answer the part about activation functions. For hidden layers, ReLU seems to be default choice, but Tanh and Sigmoid could also be fine, the best way is to try and see. For output layer, you could answer it (linear for regression, sigmoid for binary classification, softmax for multi-class problem), but the question does not specify the type of output being generated. – Akavall Dec 23 '19 at 22:27