cifar10 knn to much accuracy ?

3 visualizaciones (últimos 30 días)
michael scheinfeild
michael scheinfeild el 7 de Nov. de 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

Respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by