简体   繁体   中英

scipy.optimize.minimize - slsqp - hessian matrix

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM