BFGS
The Broyden-Fletcher-Goldfarb-Shanno algorithm, also known as the BFGS algorithm, is a gradient-based optimization algorithm. This solver uses the ‘BFGS’ algorithm from the Scipy library.
Note
BFGS is a quasi-Newton optimization algorithm for unconstrained problems.
Therefore, it does not support bounds or constraints.
Please use general nonlinear programming algorithms such as PySLSQP or IPOPT,
if your problem has bounds or constraints.
To use the BFGS solver, start by importing it as shown in the following code:
from modopt import BFGS
Options could be set by just passing them within the solver_options dictionary when
instantiating the BFGS optimizer object.
For example, we can set the maximum number of iterations maxiter
and the tolerance on the gradient norm gtol as shown below.
optimizer = BFGS(prob, solver_options={'maxiter':1000, 'gtol':1e-6})
The options available for the BFGS solver in modOpt are given in the following table.
For more information on the Scipy ‘BFGS’ algorithm, visit
Scipy documentation.
Option |
Type (default value) |
Description |
|---|---|---|
|
int ( |
Maximum number of iterations. |
|
float( |
Terminate successfully if: |
|
float ( |
Terminate successfully if |
|
float ( |
Order of the norm to be used with the two termination criteria above. |
|
float ( |
Armijo condition parameter. |
|
float ( |
Curvature condition parameter. Must satisfy |
|
np.ndarray |
Initial estimate of the objective Hessian inverse. |
|
bool ( |
Set to |
|
bool ( |
Set to |
|
callable ( |
Function to be called after each major iteration. |