Effacer les filtres
Effacer les filtres

Help for mathematical equation of regression in ANN

3 vues (au cours des 30 derniers jours)
b
b le 15 Mai 2012
With ANN toolbox, I am using neural networks for finding the regression equation.
for info, I am using Bayesian regularization with 4 variables of 30 different samples and 30 results.
Is there a way of finding the mathematical equation of that in ANN?
Thanks..

Réponse acceptée

Greg Heath
Greg Heath le 16 Mai 2012
This question has been asked many times in both the Newsgroup and Answers. If you do not use the default normalizations of input and output,
h = tansig(IW*x+b1);
y = purelin(LW*h+b2);
Otherwise you have to use the default mapminmax or alternative mapstd on x,t and y.
You can obtain details by searching on the equation for h in the Newgroup and Answers.
Hope this helps.
Greg
  1 commentaire
b
b le 16 Mai 2012
Sorry for spamming.
I do not see these for equation.

Connectez-vous pour commenter.

Plus de réponses (4)

b
b le 16 Mai 2012
Thank you so much but,
inputs = initial1';
targets = output';
hiddenLayerSize = 30;
net = newff(minmax(input),[1 10],{'tansig' 'purelin'},'trainbr');
net.IW{1}
net.b{1,1}
h=tansig(IW*inputs+b1)
targets=purelin(LW*h+b2)
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'};
net.divideFcn = 'dividerand'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
net.divideParam.trainRatio = 80/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 5/100;
net.trainFcn = 'trainbr'; % Bayesian Regularization
net.performFcn = 'mse'; % Mean squared error
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ...
'plotregression', 'plotfit'};
[net,tr] = train(net,inputs,targets);
outputs = net(inputs);
errors = gsubtract(targets,outputs);
performance = perform(net,targets,outputs)
trainTargets = targets .* tr.trainMask{1};
valTargets = targets .* tr.valMask{1};
testTargets = targets .* tr.testMask{1};
trainPerformance = perform(net,trainTargets,outputs)
valPerformance = perform(net,valTargets,outputs)
testPerformance = perform(net,testTargets,outputs)
view(net)
perf = msereg(errors,outputs,X,FP);
dy = msereg('dy',errors,outputs,X,perf,FP);
dx = msereg('dx',errors,outputs,X,perf,FP);
info = msereg(code);
net.performParam.ratio = 20/(20+1);
perf = msereg(e,net);
Gives an error why??
  2 commentaires
Greg Heath
Greg Heath le 16 Mai 2012
What is the error?
Did you try to use the debugger?
Greg
b
b le 17 Mai 2012
I am using debugger, but actually,
net.IW{1}
net.b{1,1}
There is an error. I could not solve it.

Connectez-vous pour commenter.


Greg Heath
Greg Heath le 16 Mai 2012
hiddenLayerSize = 30;
1. TOO LARGE AND INCOMPATIBLE WITH NEXT COMMAND
net = newff(minmax(input),[1 10],{'tansig' 'purelin'},'trainbr');
2. a. OBSOLETE. WHAT VERSION OF MATAB AND NNTBX DO YOU HAVE?
2.b. INCORRECT NODE SIZE ASSIGNNMENT SYNTAX
net.IW{1}
net.b{1,1}
3. ASSIGN WEIGHTS TO IW, LW
h=tansig(IW*inputs+b1)
targets=purelin(LW*h+b2)
4. TERMINATE THIS AND OTHER VOLUMINOUS OUTPUT COMMANDS WITH SEMICOLONS
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'};
net.divideFcn = 'dividerand'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
4. LAST FOUR ARE DEFAULTS: DELETE
net.divideParam.valRatio = 15/100;
5. WHY ARE YOU USING A VALIDATION SET WITH TRAINBR?
net.trainFcn = 'trainbr'; % Bayesian Regularization
6. WHY ARE YOU USING TRAINBR INSTEAD OF DEFAULT TRAINLM?
net.performFcn = 'mse'; % Mean squared error
7. MSE INCOMPATIBLE WITH TRAINBR SEE DOCUMENTATION
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ...
'plotregression', 'plotfit'};
8. NOT SURE IF THESE ARE COMPATIBLE WITH YOUR OBSOLETE VERSION OF NEWFF
perf = msereg(errors,outputs,X,FP);
dy = msereg('dy',errors,outputs,X,perf,FP);
dx = msereg('dx',errors,outputs,X,perf,FP);
info = msereg(code);
net.performParam.ratio = 20/(20+1);
perf = msereg(e,net);
9. I HAVE NO IDEA WHAT YOU ARE DOING HERE. YOU NEVER USED MSEREG FOR LEARNING
HOPE THIS HELPS.
GREG

b
b le 17 Mai 2012
hiddenLayerSize=10;
# 1- HIDDENLAYERSIZE 30 CHANGED TO 10.
# 2- MATLAB 2012a.(FORGOT TO ADD IT, SORRY FOR THAT)
net.IW{1}
net.b{1,1}
# 3- WHEN I WROTE getwb(net), IW AND B OCCUR LIKE THAT.
h=tansig(IW*inputs+b1);
targets=purelin(LW*h+b2);
# 4- SEMICOLONS ARE ADDED.
net.trainFcn='trainlm'
# 5- IT IS CHANGED TO 'TRAINLM'. IN MANY ARTICLES, BAYESIAN IS WORKED FOR MEDIA OPTIMIZATION. I CAN USE 'LM' IN MY PROJECT
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ...
'plotregression', 'plotfit'};
# 6- THEY ARE COMPATIBLE AND WORKING WITHOUT AN ERROR.
dy = msereg('dy',errors,outputs,X,perf,FP);
dx = msereg('dx',errors,outputs,X,perf,FP);
info = msereg(code);
net.performParam.ratio = 20/(20+1);
perf = msereg(e,net);
# 7- THESE FOR OBTAINIG MSEREG AND PERFORMANCE.
CAN I USE 'ADAPT' MSEREG FOR LEARNING.
THANK YOU SO MUCH.
BASAR
  2 commentaires
b
b le 17 Mai 2012
The last sentence is not correct.
I misunderstood what you said in your last sentence.
b
b le 17 Mai 2012
What can i do in msereg for learning?

Connectez-vous pour commenter.


b
b le 17 Mai 2012
Also, in one of your previous answers, you told to use.
help msereg
in the help part, it is explained like that
perf = msereg(errors,outputs,X,FP);
dy = msereg('dy',errors,outputs,X,perf,FP);
dx = msereg('dx',errors,outputs,X,perf,FP);
info = msereg(code);
net.performParam.ratio = 20/(20+1);
perf = msereg(e,net);

Catégories

En savoir plus sur Sequence and Numeric Feature Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by