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

12 次查看(过去 30 天)
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 个评论
Greg Heath
Greg Heath 2017-7-14
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

请先登录,再进行评论。

采纳的回答

Kamuran Turksoy
Kamuran Turksoy 2017-9-15
编辑:Kamuran Turksoy 2017-9-15
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 个评论
Greg Heath
Greg Heath 2017-9-15
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 2017-9-18
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.

请先登录,再进行评论。

更多回答(1 个)

Greg Heath
Greg Heath 2017-7-13
编辑:Greg Heath 2017-7-14
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

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by