different ANN predictions from manually ones

조회 수: 4 (최근 30일)
ilker ERCANLI
ilker ERCANLI 2016년 6월 14일
댓글: Tien Tran 2016년 6월 20일
I have used artificial neural network to model some individual tree attributes. In my ANN procedure, I used the feed forward backprop training procedure, including training procedure is TRAINLM, number of layers are 2, number of neurons are 10, transfer function is LOGSIG. I used ANN Matlab code;
net=newff([0 1],[10, 1],{'logsig','logsig'},'trainlm');
net.trainParam.epochs=3000;
net.trainParam.show=1000;
net.trainParam.goal=1e-10;
net.trainParam.min_grad=1e-10;
[net, tr]=train(net, input, target);
aaa=sim(net,input); w1 = net.IW{1} w2 = net.LW{2} b1 = net.b{1} b2 = net.b{2}
I want manually to calculate these simulation values, also called networkoutput in Matlab, by using weight values and biases obtained from Matlab, because these manual predictions and formulae are very important to present for reader for my article and projects,
Then I used the these formula: 1. Step: Nöron 1 = IW(1:1)*Inputnorm+b(1:1) Nöron 2 = IW(1:1)*Inputnorm+b(1:2) Nöron 3 = IW(1:1)*Inputnorm+b(1:3) Nöron 4 = IW(1:1)*Inputnorm+b(1:4) Nöron 5 = IW(1:1)*Inputnorm+b(1:5) Nöron 6 = IW(1:1)*Inputnorm+b(1:6) Nöron 7 = IW(1:1)*Inputnorm+b(1:7) Nöron 8 = IW(1:1)*Inputnorm+b(1:8) Nöron 9 = IW(1:1)*Inputnorm+b(1:9) Nöron 10= IW(1:1)*Inputnorm+b(1:10) 2. Step: Transfer functions:
E1=1/(1+EXP(-N1)) E2=1/(1+EXP(-N2)) E3=1/(1+EXP(-N3)) E4=1/(1+EXP(-N4)) E5=1/(1+EXP(-N5)) E6=1/(1+EXP(-N6)) E7=1/(1+EXP(-N7)) E8=1/(1+EXP(-N8)) E9=1/(1+EXP(-N9)) E10=1/(1+EXP(-N10))
3. Step:
Sum=LW(1:1)*E1+ LW(1:2)*E2+ LW(1:3)*E3+ LW(1:4)*E4+ LW(1:5)*E5+ LW(1:6)*E6+ LW(1:7)*E7+ LW(1:8)*E8+ LW(1:9)*E9+ LW(1:10)*E10+b((2:1)
4. Step:
output=1/(1+EXP(-Sum))
IW(1:1)=Weight value in first layer, LW(1:2)=Weight value in second layer, b(1:1)=bias values in first layer, b(2:1)= bias value in second layer.
But, I can not obtain the output values from Matlab by using these formulas, What is wrong is in these formulas. I want to point out these two prediction procedure use the same input values, It is important to determine formulas in ANN prediction. I would be glad if you help me about these subject.
Best regards.
Dr. İlker ERCANLI
  댓글 수: 1
Greg Heath
Greg Heath 2016년 6월 15일
There was a duplicate of this question in the Answer box.
It was deleted.
Greg

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

채택된 답변

Greg Heath
Greg Heath 2016년 6월 15일
I did not go through your text in detail.
However, it seems that you have not normalized input and target and unnormalized the output.
Hope this help.
Thank you for formally accepting my answer
Greg

추가 답변 (2개)

ilker ERCANLI
ilker ERCANLI 2016년 6월 15일
Dear Greg,
I normalized my input and target by using formula: (Xi-Xmin)/(Xmax-Xmin) which returned the values to 0 and 1, then I carried out feed forward backprop by using above matlab code,
I want to determine mathematical formula with weights and bias values, it is very important to present for reader for my article and projects, I used above mathematical formula including the weights and bias values obtained form matlab,
The output values that obtained from matlab are very different from the ones taht obtained from manually above formula, I used the feed forward backprop training procedure, including training procedure is TRAINLM, number of layers are 2, number of neurons are 10, transfer function is LOGSIG.
when the output values were manually calculated with above formulas, I used the normalized values that were same the ones in trainning stage, I used the LOGSIG transfer function, may be it wrong,
what is it wrong in this process,
But, I can not obtain the output values from Matlab by using these formulas, What is wrong is in these formulas. I want to point out these two prediction procedure use the same input values, It is important to determine formulas in ANN prediction. I would be glad if you help me about these subject.
Best regards.
Dr. İlker ERCANLI
  댓글 수: 1
Tien Tran
Tien Tran 2016년 6월 20일
Hi Dr. Ilker I understand your problem. I will discuss with you soon

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


Greg Heath
Greg Heath 2016년 6월 20일
You are using the colon (:) instead of the comma (,) in your matrix notation.
The jth component in the ith row of A is
A(i,j) NOT A(i:j)
Hope this helps.
Thank you for formally accepting my answer
Greg

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by