Optimal hidden nodes number

H
Hamza_ul · Jul 9, 2021 · 1.9K views
Question
Hello everybody,   In order to determine optimal hidden neurons, Trial and error algorithm has been used (trial = 10, 10 < H < 100, dH = 100). I get the table on top but i can not determine the optimal hidden neurons. The table contains (Trials, Hidden neurons, test_mse, train_mse, val_mse, test_R, train_R, val_R)
Expert Answer
Profile picture of Prashant Kumar
Prashant Kumar PhD Expert
Answered Aug 31, 2026
I have posted hundreds of examples in both the NEWSGROUP (comp.soft-sys.matlab) and ANSWERS that determine the optimal number of hidden nodes defined by
 
 
 1. One Hidden Layer (ALWAYS SUFFICIENT!!!)
 2. Minimum Number of Hidden Nodes subject to my  
    practicality constraint

    TRAINING SUBSET RSQUARE >= 0.99 

    i.e.

    99% of the training subset target variance is
    successfully modeled by the net.

    Equivalently

    TRAINING SUBSET MSE <= 0.01*TRAINING SUBSET VARIANCE

 3. COMMENTS & CAVEATS

    a. The training subset must be a good representative of 
validation and test data

    b. A smaller number of hidden nodes can often be obtained 
by using multiple hidden layers

    c. The MSE minimization technique used for regression and 
curvefitting (e.g., via FITNET)is also successful for classification 
and pattern recognition (e.g., via PATTERNNET) where the 
minimization function is cross-entropy and the desired result is 
minimal error rate.
4. Suggested NEWSGROUP and ANSWERS search words for either FITNET or PATTERNNET
 
 
greg fitnet/patternnet msegoal nmse
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!