How to customize training a Network?
1 view (last 30 days)
Show older comments
Is it possible to customize the training of a Neural Network?
I know that matlab splits the data into training, validation and test set automatically.
My question is: can you train a network with a given training set, validate it manually with a validation set and manually test it with another set?
How can I force matlab to do this?
0 Comments
Accepted Answer
Greg Heath
on 1 Apr 2012
>How to customize training a Network? >Jana asked about 3 hours ago >Is it possible to customize the training of a Neural Network?
Yes
>I know that matlab splits the data into training, validation and test set automatically.
However, it also
1. Removes constant rows
2. Prepares rows that have NaN values
3. Normalizes the input and output training variables to the closed interval [-1,1],
4. Normalizes the val and test data with the min and max values from the training set.
>My question is: can you train a network with a given training set, validate it manually with a validation set and manually test it with another set?
> How can I force matlab to do this?
You cannot manually use validation set stopping to prevent overtraining an overfit network.
However, you can use a validation set to rank multiple candidate designs obtained from many weight initialization trials for each of multiple candidate No. of hidden node values, H.
In a similar search, the other default training parameters can be overwritten.
Divide the data before creating the net. After creating the net set
net.divideParam.trainRatio = 100;
net.trainParam.goal = 0.01*mean(var(t'));
and exclude the val set from training.
See the documentation for further disussions
Getting Started: 4 sections titled "Using Command-Line Functions"
User's Guide/Advanced Topics: Custom Networks
Hope this helps.
Greg
2 Comments
Greg Heath
on 3 Apr 2012
t is the target matrix. The normalizing reference MSE, MSE00, is obtained from the Naive Constant Model with a constant output, independent of input. To minimize MSE00, the constant output is just the mean of the target values
y00 = repmat(mean(t')',1,N)
MSE00 = mean((t-y00).^2)
= ((N-1)/N)*mean(var(t'))
=~ mean(var(t'))
MSEgoal =~ MSE00/100
Hope this helps.
Greg
PS More details available by searching Newsgroup (and Answers) using keyword(s) MSE00 and/or MSEgoal.
More Answers (0)
See Also
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!