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 Center および File ExchangeStatistics 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