Hi, wanted to know that how to decide the the number of neurons in a hidden layer and also the number of hidden layers required in a neural network. I am a novice in ml , thus needed guidance
Hello, @Shinchoku_S,
A large network (more neurons / layers) tends to overfit, whereas a small one tends to underfit. Either case will hurt your evaluation score, so you fine-tune the size (and add regularization) until the evaluation score is maximized. In other words, you do experiment to find the sweet spot.
Since you tagged “week 2” for your post, please make sure to first go through Course 2 Week 3 for the explanations of the concepts of “underfit / bias”, “overfit / variance”, “evaulation”.
Cheers,
Raymond
Its a process of trial, error and previous similar applications, no definitive formula exists for it! There are automation techniques to do the search like for ex. random search, grid search etc. and you might learn about them as the course progresses!