MATLAB: Different result neural network classification

classificationneural netwrok

hi i have a dataset consist of 200 image , each 20 image printed with one printer (so classification is 10 class) extract 176 feature from each paper.
so for input i build a 176×200 matrix, 1 to 20th column (sample) belongs to 1th printer, 21 to 40th column belong to 2th printer and so on
i make a 10×200 target matrix , i set elements of 1-20 column form first row to "1" and other elements in first row to "0", for second row set 21-40 column to "1" and other to "0" and so on i use patternnet and plot confusion matrix but at every run, result is very Variable, 30 to 80% have any idea?

Best Answer

Yes. The default trn/val/tst data-division and weight initializations are all random.
For reproducibility, initialize the RNG to the same state before TRAIN is called.
Over the years I have used
rng(0) and rng(4151941) (a famous birth date).
Now I tend to use
rng('default')
To search for a good design, I usually use a double loop search over number of hidden nodes and Ntrials random generator states per hidden node choice:
rng('default')
j=0
for h = Hmin:dH:Hmax
j=j+1
net = fitnet(h);
blah; blah; blah;
for i = 1: Ntrials
net = configure(net,x,t);
blah; blah; blah;
NMSE(i,j) = mse(t-y)/mean(var(t',1));
end
end
Over the years I have posted zillions of examples in BOTH the NEWSGROUP and ANSWERS.
Hope this helps.
Thank you for formally accepting my answer
Greg