-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example from documentation doesn't work #145
Comments
Okay, replacing
Turns out, computing the Hessian-vector product was indeed necessary. The tutorial code is currently broken anyway because:
|
@jhelgert Can you comment on this since you added this example? |
There are also comments in #144 about issues with this example. |
Yes, you are right. We need to pass
where
I totally agree. However, the scipy interface tries to mimic scipy.optimize.minimize which also uses the |
I see, but that's not the Hessian, though. Users will attempt to pass functions that compute Hessians (I mean, even the documentation entry does this) and get cryptic errors saying that the function "takes 1 positional argument but 2 were given". However, it's completely unclear why the function would be passed two arguments and what these arguments are. It's not too hard to debug (I just wrapped the Hessian function in a function that accepts two argument and printed the second argument, which turned out to contain a vector; I then remembered the mysterious unused
...but Ipopt expects a function for computing the Hessian-vector product, not the Hessian itself. |
so does scipy.optimize.minimize's @moorepants What do you think? Should we change it or keep it similar to scipy? |
The example in the docs now works:
|
Code
Copied verbatim from https://cyipopt.readthedocs.io/en/stable/tutorial.html#algorithmic-differentation:
BTW, not sure why
con_eq_hessvp
andcon_ineq_hessvp
are needed - they don't seem to be used anywhere after definition.Output
Versions
The text was updated successfully, but these errors were encountered: