Neural Network transfer function

Hello,
I have this problem. I am new at Neural Networks, so I am tried to make a simple multilayer perceptron to estimate a Humps function. I used Matlab function and I succeeded, the estimation was pretty good. Later, I used the weights and the transfer function of the neurons in order to obtain the same result, nevertheless, the results were different. I would like to know if someone have had the same problem. Here is my code:
x = 0:.05:2;
y=humps(x);
P=x;
T=y;
net = feedforwardnet(10);
% train net
net.divideParam.trainRatio = 1; % training set [%]
net.divideParam.valRatio = 0; % validation set [%]
net.divideParam.testRatio = 0; % test set [%]
net= train(net,P,T);
view(net)
T_ann = net(P);
% General Transfer function calculation
weight_1 = net.IW{1};
weight_2 = net.LW{2,1};
T_modelo = ones(1,length(P));
for j=1:length(P)
T_modelo(j)=purelin(sum(tansig(P(j)*weight_1').*weight_2));
end
figure(1) plot(P,T,'Color','b') hold on plot(P,T_ann,'Color','r') hold on plot(P,T_modelo,'Color','g') grid; xlabel('time (s)');
ylabel('output');
title('humps function');
%legend('Real','ANN');
legend('Real','ANN','ANN_2');
Thank you very much.
JDC

답변 (1개)

Greg Heath
Greg Heath 2016년 9월 1일

0 개 추천

You forgot that the inputs and targets are automatically normalized before learning and the output is automatically denormalized.
This has been explained in several previous posts of both the NEWSGROUP and ANSWERS.
Try searching using the searchword
DENORMALIZATION
Hope this helps.
Thank you for formally accepting this answer
Greg

댓글 수: 1

Julius_DC
Julius_DC 2016년 9월 1일
Hello Greg,
I checked the information you suggested. It helped me a lot and I solved the problem. Thank you very much.
Greetings,
Sorry for my english grammar mistakes.
Julius DC

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

카테고리

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

질문:

2016년 8월 31일

댓글:

2016년 9월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by