How can I set the normalization of the performance parameter in training a neural network?

11 Ansichten (letzte 30 Tage)
hey, I am using the neural network toolbox. I am training a feedforward network with two outputs. The two have different dimension I need to normalize the performance parameter (mean squared error) to let them have the same 'weight' during the training. I do it with this line:
net.performParam.normalization = 'normalized';
The problem is that after the train if I go to chek the value of that parameter (net.performParam) it results as 'none', meaning it did not set 'normalized', and I cannot understand if it worked. how can I solve this problem? here I report the code in question:
net=feedforwardnet;
net=configure(net,x,t);
trainFcn = 'trainlm';
hiddenLayerSize = 22;
net = feedforwardnet(hiddenLayerSize,trainFcn);
net.performParam.normalization = 'normalized';
net.performFcn = 'mse';
[net,tr] = train(net,x,t);
  1 Kommentar
Greg Heath
Greg Heath am 14 Jul. 2017
1. ALWAYS BEGIN WITH DOCUMENTATION EXAMPLES
a. For classification/pattern-recognition
help patternnet
doc patternnet
b. For regression/curve-fitting
help fitnet
doc fitnet
c. Both call feedforwardnet with appropriate default
settings
2. Since these can be improved check the NEWSGROUP using
greg quickies
3.Finally, for more serious work, search BOTH NEWSGROUP and ANSWERS using
HITS
NEWSGROUP ANSWERS
a. patternet Hmin Hmax 4 35
or
b.fitnet Hmin Hmax 12 42

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Kamuran Turksoy
Kamuran Turksoy am 15 Sep. 2017
Bearbeitet: Kamuran Turksoy am 15 Sep. 2017
net.performParam.normalization does not have an option of 'normalized'. It has three options:
'none' (default: no normalization), 'standard' or 'percent'.
In your code you would get error if you switch the below two lines:
net.performParam.normalization = 'normalized';
net.performFcn = 'mse';
to
net.performFcn = 'mse';
net.performParam.normalization = 'normalized';
Since the default option of mse is 'none', when you define mse after performParam.normalization you overwrite it to be none.
Try this
net.performFcn = 'mse';
net.performParam.normalization = 'percent' or 'standard';
Check the link below for more information:
https://www.mathworks.com/help/nnet/ref/mse.html
  2 Kommentare
Greg Heath
Greg Heath am 15 Sep. 2017
Why are you changing anything except the number of hidden nodes???
The other default values suffice 99.99% of the time
Greg
Marco Giuliani
Marco Giuliani am 18 Sep. 2017
You are totally right Kamuran, I figured it out later using the code. I was using 'normalized' instead of 'standard' because I was using a 2011 version of matlab (and at that time the options were 'normalized' or 'percent'). By the way Greg, you need to set that option in case you have more than one output with different units. In that case, the bigger (numerically) will have an higher impact in the measure of the mse.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Greg Heath
Greg Heath am 13 Jul. 2017
Bearbeitet: Greg Heath am 14 Jul. 2017
1. You do not have to worry about normalizaion. It is a default.
2. Accept all defaults except the number of hidden nodes.
3. Create an outer for loop over hidden nodes h = Hmin:dH:Hmax
4. Create an inner loop over Ntrials configurations for random initial weights
5. Search for some of my examples
HITS
NEWSGROUP ANSWERS
FITNET Hmin Hmax 12 41
Hope this helps
THANK YOU FOR FORMALLY ACCEPTING MY ANSWER
GREG

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by