0

I use the package scipy.optimize.minimize in Python and especially with SLSQP because this algorithm is better suited to my problem. The problem is that SLSQP makes an approximation to calculate the hessian of the objective function while I know it analytically. How can I pass the hessian to the algorithm ?

Thanks.

Alexis
  • 21
  • 3

1 Answers1

0

Have a look at the documentation of minimize: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html

The hessian matrix (hess) is an optional argument.

For an analytic Hessian your input must be a callable, and it must return the matrix in the format described in the docs.

onodip
  • 635
  • 7
  • 12
  • 1
    SLSQP doesn't use analytical Hessians. You can provide one anyway, but SLSQP won't use it and will give you a message to that effect. – – JohnE May 13 '20 at 17:54