cifar10 knn to much accuracy ?

1 次查看(过去 30 天)
michael scheinfeild
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by