I'm trying to determine what is the best number of hidden neurons for my MATLAB neural network. I was thinking to adopt the following strategy:
- Loop for some values of hidden neurons, e.g. 1 to 40;
- For each NN with a fixed number of hidden neurons, perform a certain number of training (e.g. 40, limiting the number of epoch for time reasons: I was thinking to doing this because the network seems to be hard to train, the MSE after some epochs is very high)
- Store the MSE obtained with all the nets with different number of hidden neurons
- Perform the previous procedure more than 1 time, e.g. 4, to take into account the initial random weight, and take the average of the MSEs
- Select and perform the "real" training on a NN with a number of hidden neurons such that the MSE previously calculated is minimized
The MSE that I'm referring is the validation MSE: my samples splitting in trainining, testing and validation to avoid overfitting is 70%, 15% and 15% respectively)
Other informations related to my problem are:
fitting problem
9 input neurons
2 output neurons
1630 samples
This strategy could be work? Is there any better criterion to adopt? Thank you
Edit: Test done, so the result suggest me to adopt 12 neurons? (low validation MSE and number of neurons lower than 2*numberOfInputNeurons? but also 18 could be good...