Neural Networks Warehouse
Artificial Intelligence Depot
"As knowledge increases, ignorance unfolds." -Kennedy
KNOWLEDGE MESSAGES SUBMIT SEARCH  
Rebuild "traingdm" algorithm
 
• Rebuild "traingdm" algorithm

I am new to MatLab. I have an assignment about building a simulation programming for learning algorithm with momentum(or inertia)using backpropagation,steepest descent of gradient.
I think it's similar to the function "traingdm" or "traingdx" but I have to program in MatLab to run like those functions. I have many difficulties to build it.
So could you give me some suggestion and commands that help my project. I appreciate your help.

2 posts.
Thursday 16 November, 02:34
Reply
• Rebuild "traingdm" algorithm

I perform it using somecodes as follows but I think it has some problems with the error E because I can't compute the sum using cell E. But I can't change it into a matrix.please, help me:

innum= input(' innum = ');
hidnum= input(' hidnum = ');
samnum= input ('samnum =');
x= rand ( innum,1);
Wu = rand (hidnum,innum);
Wy = rand (1, hidnum);
E = {[0],[0]};
bu= rand(hidnum,1);
by= rand(1,1);

%(initupdate)
eta = input(' eta= '); %eta= learning coefficient
alpha = input(' alpha= '); %alpha = momentum coefficient
deltaW= Wu;
%-----------------------------------------------

%main
dem = 0; %bien dem nay dung de dat lam epoch
for i = 1: samnum,
%samnum(i)
d = dlearn(i,:);
x = xlearn(i,:)';
%(compute for network)
E{1,1} = E{1,2};
NETu = Wu*x-bu;
u = logsig(NETu);
NETy = Wy*u-by;
y= purelin(NETy);
E{1,2} = d-y;
%derivativeE(W)
deriv =[];
deltaE = E{1,2}-E{1,1};
for i = 1:hidnum,
for j = 1 : innum,
deriv(i,j)= deltaE/deltaW(i,j);
end;
end;
%Learning with momentum algorithm
gradE = -eta*deriv;
momenW = alpha*deltaW;
deltaW = gradE + momenW;

dem = dem + 1;
end;
.......
In the '.....' I will use the 'plot' command. Do you think it's suitable? please give me some advice.
I'm looking forward to your suggestion.

2 posts.
Thursday 16 November, 02:48
Reply