what calculation does neural network sim function do?

1 vue (au cours des 30 derniers jours)
Ismail
Ismail le 9 Avr 2014
Commenté : Greg Heath le 22 Avr 2014
Hi, I am trying to make manually the same calculation that neural network sim function does.I am using two layer neural network(input neurons+layer neurons). I need to do this because i need to gain some time. Here is how i call this function :
load('myperformance','net','ps','ts');
x=value;
W=net.IW{1};
Z=net.LW{2};
b1=net.b{1};
b2=net.b{2};
%calculation the equivalent of sim function
x_norm = mapstd('apply',x,ps);
s=Z*(W*x_norm+b1)+b2;
y = mapstd('reverse',s,ts)
but the problem is that i don't get the same result as the sim function.
Am I missing something? thank you, Ismail

Réponse acceptée

Greg Heath
Greg Heath le 11 Avr 2014
In a two layer neural network there are two layers of neurons (transfer functions), the hidden layer and the output layer. This confuses some people because there are three layers of nodes input/hidden/output. However, the input nodes are not neurons. They are fan-in units.
[xnorm, xsettings] = mapstd(x);
[tnorm, tsettings] = mapstd(t);
h = tansig(b1+IW*xnorm);
ynorm = purelin(b2+LW*h);
y = mapstd('reverse',ynorm,tsettings);
Hope this helps,
Thank you for formally accepting my answer
Greg

Plus de réponses (1)

Ismail
Ismail le 11 Avr 2014
Thank you Greg for your help.
Indeed my Neural network has just one layer ( output layer). However i have tried what you have proposed and it still does give me a different solution than the sim function. I call the two functions with the same parameters but I have different results.
Any ideas? thank you ismail
  1 commentaire
Greg Heath
Greg Heath le 22 Avr 2014
mapminmax, not mapstd, is the default

Connectez-vous pour commenter.

Catégories

En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by