Incorrect Neural Network output calculation through weights! Help!

조회 수: 8 (최근 30일)
Hi guys, I confront a problem calculating Neural Network Outputs manually through weights.
The NN has the below specifications:
Input Size 7
1 Hidden Layer of Size 10
Output Size 10
I trained the network train(network,Inputs,Targets) with trainFcn = 'trainlm' and network.layers{1}.transferFcn = 'satlins'. Others defaults.
After training I extracted the weights with the commands below:
b1 = cell2mat(network.b(1)); %Table size 10x1
IW = cell2mat(network.IW); %Table size 10x7
b2 = cell2mat(network.b(2)); %Table size 10x1
LW = cell2mat(network.LW); %Table size 10x10
but when I tried for an input X=[1,1,1,1,1,1,1]':
out1 = purelin( LW * (satlins(IW * X + b1)) + b2 );
out2=network(X);
I took different results out1~=out2.
I have searched similar problems but I cannot adapt them to my problem. Could you help me? Thanks.

채택된 답변

Greg Heath
Greg Heath 2017년 10월 23일
You did not take into account the default mapminmax normalization of inputs and outputs.
Hope this helps.
Thank you for formally accepting my answer
Greg
  댓글 수: 1
Nikos Vasileiadis
Nikos Vasileiadis 2017년 10월 23일
Thank you Greg! Could you be more specific on how I can modify my calculation to have the right result? I tried to do something like this:
out1 = mapminmax (purelin( LW * (satlins(IW * mapminmax (X) + b1)) + b2 ));
but it didn't work.

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

추가 답변 (0개)

카테고리

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