How can I correctly calculate the outputs of the hidden layers in a neural network?

I have a one hidden layer feed-forward backpropagation network. such as:
net=newff(P,T,[32],{'tansig','logsig'},'trainlm');
I trained it using a set of input data and set the output equal to the inputs. I noticed I couldn't directly access to the outputs of the hidden layer. Therefore, I wrote the following to calculate the outputs of the hidden layer:
IW = net.IW{1};
b1 = net.b{1};
h1 = tansig(IW*P + repmat(b1,H,N));
Additionally, I want to check the calculation was correct. Therefore, I continued wrote as following to calculate the outputs of output layer:
LW = net.LW{2};
b2 = net.b{2};
h2 = logsig(LW*h1 + repmat(b2,H,N));
However, the calculated outputs didn't match the simulation outputs. Can anyone help me to explain the reasons caused this?

 채택된 답변

Greg Heath
Greg Heath 2015년 10월 23일
You did not take into consideration the default normalization of the input and target as well as the default denormalization of the output.
This topic has been covered many times in both the NEWSGROUP and ANSWERS. You should be able to search and find several relevant posts.
Hope this helps.
Thank you for formally accepting my answer
Greg

추가 답변 (1개)

tracey zhang
tracey zhang 2015년 10월 23일
Dr. Heath,
Would you like to provide me more detail info on the default normalization and denormalization?
Thank you so much, Tracey

댓글 수: 1

No. I have covered this topic more than once.
I would like you to practice searching in the NEWSGROUP and ANSWERS.
Hope this helps.
Greg

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

카테고리

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

질문:

2015년 10월 22일

댓글:

2015년 10월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by