cifar10 knn to much accuracy ?

조회 수: 1 (최근 30일)
michael scheinfeild
michael scheinfeild 2017년 11월 7일
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