필터 지우기
필터 지우기

How to get the transfer function equation for the implemented neural network

조회 수: 1 (최근 30일)
I have implemented neural network of two layers and hidden layer size is 3. for both layers activation function is purelin. When I calculate theoretically output of neural network it is not matching with output provided by neural network of matalab. Plz let me know where i am doing wrong. Thanks

채택된 답변

Greg Heath
Greg Heath 2016년 11월 9일
You have to obtain xsettings and tsettings from x and t.
Then apply them to x2 and t2.
Hope this helps.
Thank you for formally accepting my answer
Greg

추가 답변 (1개)

Greg Heath
Greg Heath 2016년 9월 14일
편집: Greg Heath 2016년 9월 14일
I misplaced my turban and crystal ball. Therefore I cannot tell you where you have gone wrong.
OH! It just occurred to me!
1. Why don't you post your code?
2. Include any comments and error messages that result when you try
to run your code.
3. Include the results of running your code on data in the help
and doc documentation. e.g.,
help fitnet
doc fitnet
Thank you for formally accepting my answer
Greg
PS. Have you included
a. the normalization of input and target
b. The denormalization of the output
Hope this helps.
Greg
  댓글 수: 6
jalpa shah
jalpa shah 2016년 11월 2일
Hi, thanks for replying. Can u plz tell me how to deactivate the normalization step which is by default as per the link ( http://in.mathworks.com/help/nnet/ug/choose-neural-network-input-output-processing-functions.html). Thanks
jalpa shah
jalpa shah 2016년 11월 5일
Dear Greg, I have tried your tutorial code and pasted the code which i have tried. In code for lines (1), (2) and (3), when I put X and t instead of x2 and t2 then ya from equation and y are matching. But when I put x2 and t2 then yn and ya both are coming as 0.678 from equations and y2 from simulation of net coming as 4.3997. Means y2 output from simulation does not match with ya calculated from equation.
can you please tell me why its happening like this? your help will be appreciated. thanks
x= [9.71771231870987,9.83342660442415,9.97628374728129]
t= [4.39863796358009,4.69563206044186,4.91324004903954]
x2= [9.62398374728130]
t2= [4.09380849773465]
net = fitnet;
rng( 4151941 )
[ net tr y e ] = train( net, x, t );
y2=sim(net,x2);
% THE ANALYTIC I/O RELATIONSHIP
xn = mapminmax(x2); %.....(1)
[ tn, tsettings ] = mapminmax(t2); %....(2)
[p,N]= size(x2); %......(3)
b1 = net.b{1} ; % [ H 1 ]
IW = net.IW{ 1 ,1 }; % [ H I ]
b2 = net.b{2} ; % [ O 1 ]
LW = net.LW{ 2, 1 }; % [ O H ]
whos b1 IW b2 LW
B1 = repmat( b1 , 1, N ) ;
B2 = repmat( b2 , 1, N ) ; % For O > 1
yn = B2 + LW * tanh( B1 + IW * xn );
ya = mapminmax.reverse(yn,tsettings);
end

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

카테고리

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