本文介绍了并行计算工具箱fminsearch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我以前从未使用过并行计算.这就是为什么我的问题可能很愚蠢.我有一个用于最小二乘函数"bla"的优化程序.

I have never used parallel computing before. Thats why my question can be silly. I have a optimisation program for my least squared function "bla"

d=@(p)bla(m1,m2,m3,p,m2,m3);
pstart=0.2;
[pbest,likemodelvalue]=fminsearch(d,pstart,options)

但是它非常慢.是否可以对f的每个值都使用带有fminseach的prallel编程?

But it is extremely slow. Can I use prallel programming with fminseach, for each value of "p"?

推荐答案

优化工具箱具有一些并行计算工具,还需要购买并行计算工具箱.这些功能的说明如下: http://www.mathworks.com/help/optim/ug/using-parallel-computing-with-fmincon-fgoalattain-and-fminimax.html .我不确定那是否正是您想要的.如果要为不同的pstart值找到多个不同的pbset值,则可以执行以下操作(同样,使用并行计算工具箱)

The Optimization Toolbox has some parallel computing facilities, for which you also need to purchase Parallel Computing Toolbox. These capabilities are described here: http://www.mathworks.com/help/optim/ug/using-parallel-computing-with-fmincon-fgoalattain-and-fminimax.html . I'm not sure if that's quite what you want though. If you want to find multiple different values of pbset for different values of pstart, you could do something like this (again, using Parallel Computing Toolbox)

matlabpool open local % launch local workers
pstart = 0:0.2:10;
for ii = 1:numel(pstart)
    [pbest(ii), likemodelvalue(ii)] = fminsearch(d, pstart(ii), options);
end

这篇关于并行计算工具箱fminsearch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 10:54