0
101 Jan 13, 2005 at 17:56

Question:
Design a network that classify 5 classes.
class 5: a square that centre is (0,0) and width is 12.

However, when I train the network use the following code, I cannot get good result. The Matlab tell me that network error did not reach the error goal.Further training may be necessary. I do not konw the reason. Then I increase the number of hidden node, but I got the same result.
Please give me some advice. The following part is my Matlab code.
for i=1:500
training(1,i)=12*(rand(1)-0.5);
training(2,i)=12*(rand(1)-0.5);
end;
for i=1:size(training,2)
if ((training(1,i)-2)\^2+(training(2,i)-2)\^2)<1
output(:,i)=[1 0 0 0 0]’;
elseif ((training(1,i)-2)\^2+(training(2,i)+2)\^2)<1
output(:,i)=[0 1 0 0 0]’;
elseif ((training(1,i)+2)\^2+(training(2,i)-2)\^2)<1
output(:,i)=[0 0 1 0 0]’;
elseif ((training(1,i)+2)\^2+(training(2,i)+2)\^2)<1
output(:,i)=[0 0 0 1 0]’;
else
output(:,i)=[0 0 0 0 1]’;
end;
[w1,b1,w2,b2]=initff(training,100,’logsig’,output,’logsig’);

[w1,b1,w2,b2]=trainbpx(w1,b1,’logsig’,w2,b2,’logsig’,training,output,-1);

Thank you.