cifar10 knn to much accuracy ?

1 Ansicht (letzte 30 Tage)
michael scheinfeild
michael scheinfeild am 7 Nov. 2017
i classify cifar10 for first group with knn and receive 100 percent accuracy i think it should happen
imgSetTrain=imageSet(fullfile(pathcifar,'cifar10Train'), 'recursive');
imgSetTest=imageSet(fullfile(pathcifar,'cifar10Test'), 'recursive');
classNames = { 'airplane' , 'automobile' , 'bird',...
'cat' , 'deer' , 'dog' , 'frog',...
'horse' , 'ship' , 'truck'};
ActDet =[];
knn=5;
for( k=1)%length(imgSetTest))
disp(k)
curSet=imgSetTest(k);
detectClass=zeros(curSet.Count,1);
for(ji=1:curSet.Count)
imgcur=gpuArray(read(curSet,ji));
% run on train
AllDist=[]; AllGroups=[];
for( kr=1:length(imgSetTrain))
kr
curSetTrain=imgSetTest(kr);
for(jir=1:curSetTrain.Count)
imgTrain=gpuArray(read(curSetTrain,jir));
AllGroups=[AllGroups;kr];
distImg=abs(imgcur-imgTrain);
distImg = sum(distImg(:))/numel(distImg);
AllDist=[AllDist ;distImg];
end
end
[dataSel indexSel]=sort(AllDist) ;
selGroups = AllGroups(indexSel(1:knn));
[js jsh]=hist(selGroups,[1:10]);
[kjs kjsi]=max(js);
detectClass(ji)=kjsi;
ActDet = [ActDet; k detectClass(ji)]
end
end

Antworten (0)

Kategorien

Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by