Skip to content
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

Prepared sparse hessian! calls prepare_gradient at every invocation? #376

Closed
Vaibhavdixit02 opened this issue Jul 22, 2024 · 4 comments
Closed
Labels
core Related to the core utilities of the package

Comments

@Vaibhavdixit02
Copy link
Contributor

@gdalle
Copy link
Member

gdalle commented Jul 23, 2024

Yes indeed. That's because preparation is shared among four variants of the operator: in-place/out-of-place, with/without the value. For second-order operators, the variant "with value" also returns a first derivative: value and hessian would be a bit weird if I didn't return the gradient as well. So this is a performance tradeoff I make in order not to have four variants of the preparation syntax. What do you think?

@gdalle gdalle added the core Related to the core utilities of the package label Jul 23, 2024
@Vaibhavdixit02
Copy link
Contributor Author

I would really like a way to avoid this, even if it's an internal API and not as convenient as hessian! call. Is there something I can use?

@gdalle
Copy link
Member

gdalle commented Jul 23, 2024

Why do you want to avoid this? Where is it costing you?

@gdalle
Copy link
Member

gdalle commented Jul 29, 2024

This is the same issue as #86, partially solved by #385

@gdalle gdalle closed this as completed Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the core utilities of the package
Projects
None yet
Development

No branches or pull requests

2 participants