I have aproblem in newelm

I used newelm to train the network and used the result of weight to make a pratic elman network but i had different result can i know where is thee wrong . when i used this code:
n=[0 1 0 1]
t=[1 0 1 0]
net=newelm(n,t,1,{'tansig','purelin'})
net=train(net,n,t)
wb=getwb(net)
o=sim(net,n)
n1=[-1 1 -1 1]
t1=[1 -1 1 -1]
h=0
for k=1:4
h=tansig(n1(k)*wb(2)+h*wb(3)+wb(1))
y(k)=purelin(h*wb(5)+wb(4))
end
thanks

 Accepted Answer

Your values of wb(k) are in the wrong order. Try
IW = cell2mat(net.IW)
b = cell2mat(net.b)
LW = cell2mat(net.LW)
HTH
Greg

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Asked:

ula
on 15 Nov 2013

Answered:

on 29 Nov 2013

Community Treasure Hunt

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

Start Hunting!