-
Notifications
You must be signed in to change notification settings - Fork 233
Allow generic solver to be passed to Newton method #1176
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
base: master
Are you sure you want to change the base?
Allow generic solver to be passed to Newton method #1176
Conversation
Benchmark Results
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
|
Thanks, I'll review :) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1176 +/- ##
==========================================
+ Coverage 85.70% 85.75% +0.04%
==========================================
Files 46 46
Lines 3596 3601 +5
==========================================
+ Hits 3082 3088 +6
+ Misses 514 513 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| g = gradient(d) | ||
|
|
||
| # Clean and simple - just call the user's solve function | ||
| state.s .= method.solve(H, g) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the default solver, this seems less efficient than the current implementation. AFAICT this would introduce a regression as currently for Arrays both the cholesky decomposition of the Hessian is computed in place and then also the in-place ldiv! solver is used.
This PR is in reference to issue #1170. To solve this I have edited the interface to allow a user to pass a generic solver. This in theory would allow one to use any matrix type given the user has that package loaded and there exists a solver designed for that matrix type on board. This also allows one to write a custom solver (i.e., problem specific factorization, strategies for solving) to circumvent the default behavior. I have included some examples of this in testing including:
Let me know if there are any other tests you would like me to include or changes to the documentation.