How many neurons?

How do we decide how many neurons per layer to use (apart from input and output layer) in hidden layers and how many layers do we use in the model?

Hello @Apurva_Sen

Welcome to our community.

There is no 1 correct answer to this question. It involves a trial and error process and would require experimentation.

1 Like

Hi Shanup,
Are there any tricks or tips I should keep in mind when I try to design a neural network. I mean I have to start with something and then do some experiments to see if I am in the right direction or not. How do I decide on the initial ball park numbers?

A general rule:
Only add as much complexity as is needed to get good enough results.

Tips:

  • start with one hidden layer. Add more only if necessary.
  • for the number of units in the hidden layer, two rules-of-thumb are a) the square root of the number of input features, and b) the average between the input features and the output labels.
1 Like