test for RBF NN
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hi every one i have tarined an RBF NN using newrbe but for testing when i use sim or net i get the same outputs for all inputs i didn't know why this is my code close all clear all clc data = load('MNISTr-784-10-60000.txt'); nombrezero=0; nombreun=0; nombredeux=0; nombretrois=0; nombrequatre=0; nombrecinq=0; nombresix=0; nombresept=0; nombrehuit=0; nombreneuf=0; figure; for i=1:500 subplot(10,50,i) i1=data(i,1:784); c=1; for j1=1:28 for j2=1:28 input(j1,j2)=i1(c); c=c+1; end end imshow(input); t(:,i)=data(i,785:794)'; target=data(i,785:794); for k=1:10 if target(k)==1 target=k-1; break; end end title(target); if target==0 nombrezero=nombrezero+1; elseif target==1 nombreun=nombreun+1; elseif target==2 nombredeux=nombredeux+1; elseif target==3 nombretrois=nombretrois+1; elseif target==4 nombrequatre=nombrequatre+1; elseif target==5 nombrecinq=nombrecinq+1; elseif target==6 nombresix=nombresix+1; elseif target==7 nombresept=nombresept+1; elseif target==8 nombrehuit=nombrehuit+1; else nombreneuf=nombreneuf+1; end; p(:,i)=transpose(i1);
end
%disp(t) size(t) size(p) fprintf(' nombre de 0= %d .\n',nombrezero) fprintf(' nombre de 1= %d .\n',nombreun) fprintf(' nombre de 2= %d .\n',nombredeux) fprintf(' nombre de 3= %d .\n',nombretrois) fprintf(' nombre de 4= %d .\n',nombrequatre) fprintf(' nombre de 5= %d .\n',nombrecinq) fprintf(' nombre de 6= %d .\n',nombresix) fprintf(' nombre de 7= %d .\n',nombresept) fprintf(' nombre de 8= %d .\n',nombrehuit) fprintf(' nombre de 9= %d .\n',nombreneuf) net = newrb(p,t) view(net)
data1 = load('MNISTs-784-10-10000.txt'); h1=1; e=0; figure; for ij=1:100 subplot(10,10,ij) i11=data1(ij,1:784); c1=1; for j11=1:28 for j21=1:28 test(j11,j21)=i11(c1); c1=c1+1; end end
imshow(test);
target1=data1(ij,785:794)';
for k1=1:10
if target1(k1)==1 t=k1-1;
break;
end
end
title(t);
p1(:,ij)=transpose(i11);
%disp(target1);
end
y=net(p1);
%fprintf(' y+target1= %d .\n',y+target1)
for h=1:10
if(y(h)+target1(h)>1.1) %somme des deux vecteurs
e=e+1;
end
end
disp(y)
disp(e)
the problem is on y it has the same columns thank you
0 commentaires
Réponses (0)
Voir également
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!