The optimal approach is to learn the best way to take advantage of existing MATLAB functions and structure. Although it is not necessarily the approach that you proposed, it is no less valid.
For example, by default, MATLAB NN design functions automatically
1. Normalize input and target data
2. Divide the data into training, validation and test subsets.
3. Initialize default parameter settings including random initial
weights
4. Train the net until one of several conditions occur. For example
a. Training subset error is reduced to a specified level
b. Validation subset error increases continually for a
specified number (default = 6) of epochs
c. A maximum number (default = 1000) of epochs is reached.
5. Use the target normalization parameters to
unnormalize the output data
6. Calculate the performance measure
Simple examples are given in the help and doc documentation examples obtained using the commands
and
Typically, there are two main reasons for unsuccessful efforts:
1. Inadequate (high or low) specification for the number of hidden nodes
2. Inappropriate choice of random initial weights.
Consequently, I have devised a double loop approach where
1. The outer loop is over an interval for the number of hidden nodes
2. The inner loop is over a number of random initial weight settings
Examples can be found by searching both NEWSGROUP and ANSWERS using search words that include
or
Hope this helps
Thank you for formally accepting my answer
Greg
Best Answer