필터 지우기
필터 지우기

Classification error for parfor

조회 수: 3 (최근 30일)
Abhishek Bhatia
Abhishek Bhatia 2015년 4월 2일
편집: Abhishek Bhatia 2015년 4월 2일
I wished to write the below code in parallel:
max=0;
numvalues1=OpParam(1);
numvalues2=OpParam(2);
for i =LB(1):((UB(1)-LB(1))/(numvalues1 -1)):UB(1),
for j =LB(2):((UB(2)-LB(2))/(numvalues2 -1)):UB(2
acc=ComputeCbetaPerm( [i j],featureMatrix,labelMatrix);
if(acc < max)
acc=max;
values=[i j];
end
end
end
I Changed to the below to avoid the use of temporary variable `max` but still it gives an error of classification which I don't get.
numvalues1=OpParam(1);
numvalues2=OpParam(2);
Result=cell(numvalues1,numvalues2,1);
outervalues=LB(1):((UB(1)-LB(1))/(numvalues1 -1)):UB(1);
innervalues=LB(2):((UB(2)-LB(2))/(numvalues2 -1)):UB(2);
for (i =1:numel(outervalues)),
parfor (j =1:numel(innervalues)),
acc=ComputeCbetaPerm( [outervalues(i) innervalues(j)],featureMatrix,labelMatrix);
Result(i,:,1)={outervalues(i),innervalues(j),acc};
end
end
Also asked http://stackoverflow.com/questions/29414645/classification-error-for-parfor

답변 (0개)

카테고리

Help CenterFile Exchange에서 Parallel Computing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by