Classification error for parfor

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