NLopt的Gradient-based versus deri
2019-03-12 本文已影响0人
布织岛
使用Gradient-based算法需要在代码中写出所求的各个变量的一阶导函数。
1 什么时候用Gradient-based算法?有什么好处呢?
Especially for local optimization, the most efficient algorithms typically require the user to supply the gradient ∇fin addition to the valuef(x) for any given pointx(and similarly for any nonlinear constraints).
Gradient-based算法的计算会很快。
2 什么时候适合用derivative-free algorithm?
On the other hand, computing the gradient is sometimes cumbersome and inconvenient if the objective function is supplied as a complicated program. It may even be impossible, iffis not differentiable (or worse, is discontinuous). In such cases, it is often easier to use a derivative-free algorithm for optimization, which only requires that the user supply the functionvaluesf(x) for any given pointx.