Optimization with a vectorized objective function
3 ビュー (過去 30 日間)
古いコメントを表示
Hello,
The objective function that I am trying to optimize is highly vectorized meaning that if someone passed thousands of points to it at once, the function would do its job much more efficiently. The problem is that such optimization routines as fminunc are only capable of evaluating one point at a time; at least I could not find a way to turn on this feature if it does exist. I would be very grateful for any suggestions. Thank you.
Best wishes, Ivan
2 件のコメント
José-Luis
2013 年 2 月 1 日
編集済み: José-Luis
2013 年 2 月 1 日
What do you mean by a highly vectorized objective function? An objective function returns a scalar. Are you talking about multiple objective optimization? If that is the case, I don't think you can optimize directly. You either need to express it as a scalar or do some sort of Pareto optimization.
採用された回答
Matt J
2013 年 2 月 1 日
編集済み: Matt J
2013 年 2 月 1 日
What you're talking about might be possible with GA in the Global Optimization Toolbox. Since global optimization algorithms work with a population of many initial points, it makes sense for it to allow you to vectorize these evaluations.
It doesn't really make sense for the purposes of FMINUNC, though. The whole aim in local optimization code like FMINUNC is to work with one initial point (presumed to be a good one) and to keep to a minimum the number of function evaluations that you have to do. Global optimization algs only work with multiple initial points because they have to.
You could, however, use the efficiency you're talking about to help select a good initial point, which would help improve the speed of FMINUNC. Taking your example of
f=@(x) x.^2
you could do
xspace=linspace(-2,2,1000);
[~,i]=min(f(xspace));
x0=f(xspace(i));
fminunc(f,x0,...)
3 件のコメント
Sean de Wolski
2013 年 2 月 1 日
@Ivan the 'UseParallel' option is used just calculate the central differences for the gradients. If you want to use this, try fmincon() ( Interior-point algorithm is recommended) with bounds and the 'UseParallel' flag on.
Matt J
2013 年 2 月 1 日
There's also nothing stopping you from using PARFOR and other PCT functions to parallelize operations inside your objective function.
その他の回答 (1 件)
Shashank Prasanna
2013 年 2 月 1 日
Ivan, MultiStart may just be what the doctor ordered. It kicks off at several different points and takes different paths in an attempt to find a global minima:
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!