Question
i'm trying to to optimizing thyroeid example by pattern recognition . i wana modify hidden layer size , and i want it from ga function , in default way is : hiddenLayerSize = [4 5 ] ; net = patternnet(hiddenLayerSize); now i want hiddenLayerSize get from ga func , that gaves me minimum and optimal number of neuron .
Expert Answer
Prashant Kumar
PhD Expert
Answered Aug 25, 2026
Are you sure you want the complexity of 2 hidden layers?
One is sufficient.
How many input/target pairs? N =
Input vector dimensionality? I =
Number of classes ? c =
Are target columns also columns of eye(c)?
Default datadivision? Ntrn/Nval/Ntst = (0.7/0.15/0.15)*N
Are the No. of training equations Ntrneq = Ntrn*c
greater than number of unknown weights?
Nw = (I+1)*H+(H+1)*c % One hidden layer Nw = (I+1)*H1+(H1+1)*H2+(H2+1)*c % Two hidden layers?
Search both the NEWSGROUP and ANSWERS using
PATTERNNET GENETIC
And
PATTERNNET GA
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
Related hiddenlayersize Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →