In neural net function, how can I see normalized input data?

The neural network function uses mapminmax function.
When I use neural network, I want to see normalized input data using mapminmax function.
But, I can't find normalized input data.
How can I see normalized input data?
Please help me.

Risposte (1)

You have to use MAPMINMAX and calculate them yourself.
The normalization inside of the training function is not accessible. For details you can look up
help mapminmax
doc mapminmax
Hope this helps
Thank you for formally accepting my answer
Greg

6 Commenti

Thank you for your reply.
I have a question.
I tried to normalize it in the way you gave it.
This is the code.
% Automatic Normalization
[x,t] = simplefit_dataset;
net = newfit(x,t,10);
net = setwb(net,0.5*(ones(10+1)));
net.divideFcn = 'divideind';
net.divideParam.trainInd = 1:60;
net.divideParam.valInd = 61:94;
net.divideParam.testInd = 94;
[net, tr] = train(net,x,t);
y = net(4)
% Manual Normalization
[x,t] = simplefit_dataset;
net = newfit(x,t,10);
net.inputs{1}.processFcns={};
net.outputs{2}.processFcns={};
[x,ps] = mapminmax(x);
[t,pt] = mapminmax(t);
net = setwb(net,0.5*(ones(10+1)));
net.divideFcn = 'divideind';
net.divideParam.trainInd = 1:60;
net.divideParam.valInd = 61:94;
net.divideParam.testInd = 94;
[net, tr] = train(net,x,t);
y = net(mapminmax('apply',4,ps));
y = mapminmax('reverse',y,pt)
The first code uses the normalization
function of the neural network, the second
code turns off the normalization function
of the neural network, and the mapminmax
function is entered manually.
I think the result of this code should be the same. However, the result y was different. Could you tell me why?
I will answer soon. Meanwhile, you may want to take a look at some of these in BOTH Newsreader and Answers.
Hope this is helpful.
Greg
Search using
greg simplefit_dataset
P.S. NEWFIT is obsolete. Do you have FITNET?
Another quickie that takes advantage of defaults
tic, [ x,t ] = simplefit_dataset;
rng(0), [net tr y e ] = train(fitnet,x,t);
plot(x,t,'b',x,y,'ro'), NMSE = mse(e)/var(t,1), toc
% NMSE = 1.7558e-05
% Elapsed time is 0.548107 seconds.
Yes, I have a fitnet.
And I mean
Case1 Using mapminmax function provided by fitnet function
% Automatic Normalization
[x,t] = simplefit_dataset;
net = fitnet(10);
rng(0)
net.divideFcn = 'divideind';
net.divideParam.trainInd = 1:60;
net.divideParam.valInd = 61:94;
net.divideParam.testInd = 94;
[net, tr] = train(net,x,t);
y = net(4) % y = 7.2376
Case2 Using mapminmax directly without using the internal mapminmax function of fitnet
% Manual Normalization
[x,t] = simplefit_dataset;
net = fitnet(10);
rng(0)
net.inputs{1}.processFcns={}; % off mapminmax
net.outputs{2}.processFcns={}; % off mapminmax
[x,ps] = mapminmax(x);
[t,pt] = mapminmax(t);
net.divideFcn = 'divideind';
net.divideParam.trainInd = 1:60;
net.divideParam.valInd = 61:94;
net.divideParam.testInd = 94;
[net, tr] = train(net,x,t);
y = net(mapminmax('apply',4,ps));
y = mapminmax('reverse',y,pt) % y = 7.1137
The result of 2 cases vary from 7.2376 to 7.1137.
Do these two cases have the same result?
Do not just look at just one output point when you have 94. The best measure I can think of is the normalized mean square difference
NMSD = mse(y2-y1)/var(t,1)
However, use the default 0.7/0.15/0.15 data division ratio and compute the differences for the trn, val and tst subsets.
Hope this helps.
Thank you for formally accepting my answer
Greg
Thank you for this post. I really learned from it. As I result, see
http://www.mathworks.com/matlabcentral/... newsreader/view_thread/349217#955612
Thanks again,
Greg

Accedi per commentare.

Categorie

Scopri di più su Deep Learning Toolbox in Centro assistenza e File Exchange

Richiesto:

il 29 Lug 2017

Commentato:

il 31 Lug 2017

Community Treasure Hunt

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

Start Hunting!