the meaning of 'MaxFunEvals' in 'fmincon'
10 次查看(过去 30 天)
显示 更早的评论
Hello,
The description of the argument 'MaxFunEvals' for 'fmincon' is 'Maximum number of function evaluations allowed.' I don't know which function it is referring to. Can someone help explain it in more details?
Thanks a lot!
Sincerely
Elvin
0 个评论
采纳的回答
Friedrich
2014-5-2
Hi,
it refers to the objective function, e.g.
fmincon(@myfun,....)
and setting MaxFunEvals to 1000 would mean that the fmincon function stops optimizing after calling 1000 times myfun (as long no other stop creatia was hit).
2 个评论
Friedrich
2014-5-2
编辑:Friedrich
2014-5-2
Hi,
it can be called multiple times and each call counts as function evaluation. You also can call the objective function to calcualte the finite differences (gradient). Maybe have a look here.
Whenever, MATLAB starts an optimization routine, a solver begins at an initial value x0, performs some intermediate calculations that eventually lead to a new point x1, and then repeats the process to find successive approximations x2, x3, ... of the local minimum. Processing stops after some number of iterations k.
At any step, intermediate calculations may involve evaluating the objective function and constraints, if any, at points near the current iterate xi. For example, the solver may estimate a gradient by finite differences. At each of these nearby points, the function count (F-count) is increased by one.
It's important to note that there are no checks for MaxFunEvals throughout each step of an optimization algorithm. Doing so adds unnecessary time. Rather, most (all) algorithms check at the beginning or end of an iteration.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!