Regressin equation from neural network does not match to net(x)

Hello,
I have created the codes using the button in the nnstart toolbox 'simple script' as below. After training I have compared the values using following commands and it was showing me different results.
  • y1 = b2 + LW*tanh(b1+IW*x)
  • y2 = net(x)
Could someone please help me what the promblem is?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
load('Input_Output.mat') % Data attached
inputs = Input_transpose; targets = Output_transpose;
hiddenLayerSize = 10; net = fitnet(hiddenLayerSize);
net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100;
[net,tr] = train(net,inputs,targets);
outputs = net(inputs); errors = gsubtract(targets,outputs); performance = perform(net,targets,outputs)
view(net)
b1 = net.b{1};
b2 = net.b{2};
IW = net.IW{1,1};
LW = net.LW{2,1};
x = Input_transpose(:,1)
y = b2 + LW*tanh(b1+IW*x)
net(x)

 채택된 답변

Greg Heath
Greg Heath 2015년 4월 19일
편집: Greg Heath 2015년 4월 19일

0 개 추천

You did not take into account the default minmax normalization of inputs and targets
See
Hope this helps.
Greg

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

질문:

2015년 4월 17일

댓글:

2020년 6월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by