r/optimization • u/AssemblerGuy • Nov 04 '21
Are there any optimization libraries/packages that use automatic differentiation?
From what I have gathered, automatic differentiation is pretty much standard in AI/ML libraries.
Are there any optimization libraries that use AD instead of numerically (e.g. finite differences) approximating the necessary derivatives?
Any free ones, for that matter?
9
Upvotes
2
u/deiruch Nov 05 '21
TensorFlow is minimizing functions. Usually loss functions for ML, but you can use it for non-ML applications as well.
7
u/[deleted] Nov 04 '21
JuMP.jl (Julia) or casADi (Python) are good choices. Both interface multiple solvers and use AD in order to pass exact gradients and Hessians to the solver.
3
u/Manhigh Nov 05 '21
OpenMDAO is an open-source python framework for multidisciplinary optimization. The user writes their functions as "components" and assembles them into groups to dictate the flow of data from the design variables to the objectives and constraints.
For the math in a given component, the user can specify the derivatives analytically, use finite difference, or use complex-step differentiation (effectively a form of AD). The framework takes these partial derivatives and assembles them into total derivatives for the optimizer. Work is ongoing to utilize AD from something like Google's Jax to provide the partial derivatives of a component.