0 down vote favorite

I am using the following code for grid search on libsvm:

bestcv = 0;
for log2c = -1:3,
  for log2g = -4:1,
    cmd = ['-v 5 -c ', num2str(2^log2c), ' -g ', num2str(2^log2g)];
    cv = svmtrain(heart_scale_label, heart_scale_inst, cmd);
    if (cv >= bestcv),
      bestcv = cv; bestc = 2^log2c; bestg = 2^log2g;
    end
    fprintf('%g %g %g (best c=%g, g=%g, rate=%g)\n', log2c, log2g, cv, bestc, bestg, bestcv);
  end

To increase the speed, I can either go for Parallel computing toolbox or running this on GPUs (though I guess first option would be better because GPUs are good at operations like convolution etc which are not so heavy in this case - please correct me if I am wrong.)

How can I optimize this by running it on Parallel computing toolbox? I am beginner in this field and therefore need some input on how to implement the parfor loops.

Thanks

asked Apr 13 '14 at 22:06

Sharath%20Chandra's gravatar image

Sharath Chandra
311131621

Be the first one to answer this question!
toggle preview

powered by OSQA

User submitted content is under Creative Commons: Attribution - Share Alike; Other things copyright (C) 2010, MetaOptimize LLC.