필터 지우기
필터 지우기

Help for mathematical equation of regression in ANN

조회 수: 3 (최근 30일)
b
b 2012년 5월 15일
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..

채택된 답변

Greg Heath
Greg Heath 2012년 5월 16일
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
b
b 2012년 5월 16일
Sorry for spamming.
I do not see these for equation.

댓글을 달려면 로그인하십시오.

추가 답변 (4개)

b
b 2012년 5월 16일
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
Greg Heath
Greg Heath 2012년 5월 16일
What is the error?
Did you try to use the debugger?
Greg
b
b 2012년 5월 17일
I am using debugger, but actually,
net.IW{1}
net.b{1,1}
There is an error. I could not solve it.

댓글을 달려면 로그인하십시오.


Greg Heath
Greg Heath 2012년 5월 16일
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 2012년 5월 17일
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
b
b 2012년 5월 17일
The last sentence is not correct.
I misunderstood what you said in your last sentence.
b
b 2012년 5월 17일
What can i do in msereg for learning?

댓글을 달려면 로그인하십시오.


b
b 2012년 5월 17일
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);

카테고리

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