-
Notifications
You must be signed in to change notification settings - Fork 57
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
[PLS Refactor] Linear solver stopping criteria #499
[PLS Refactor] Linear solver stopping criteria #499
Conversation
Codecov Report
@@ Coverage Diff @@
## main #499 +/- ##
==========================================
+ Coverage 87.62% 87.72% +0.10%
==========================================
Files 155 160 +5
Lines 5963 6012 +49
Branches 771 772 +1
==========================================
+ Hits 5225 5274 +49
+ Misses 505 504 -1
- Partials 233 234 +1
|
Note that this PR is a follow-up to #494 and should therefore be reviewed after. |
@JonathanWenger I merged |
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.
👍🏻
src/probnum/linalg/solvers/stopping_criteria/_linear_solver_stopping_criterion.py
Outdated
Show resolved
Hide resolved
src/probnum/linalg/solvers/stopping_criteria/_linear_solver_stopping_criterion.py
Outdated
Show resolved
Hide resolved
src/probnum/linalg/solvers/stopping_criteria/_linear_solver_stopping_criterion.py
Show resolved
Hide resolved
) -> bool: | ||
|
||
residual_norm = np.linalg.norm(solver_state.residual, ord=2) | ||
b_norm = np.linalg.norm(solver_state.problem.b, ord=2) |
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.
We might want to cache this
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.
As we previously discussed offline, I would avoid caching the residual or right-hand side at this point, before we actively need it for performance. We may want to either recompute the residual in each step for stability or update the (estimate of) right hand side at each step in the noisy case. Let me know if your opinion on this is different.
Co-authored-by: Marvin Pförtner <[email protected]>
…opping_criterion.py Co-authored-by: Marvin Pförtner <[email protected]>
Co-authored-by: Marvin Pförtner <[email protected]>
In a Nutshell
This PR adds stopping criteria for the probabilistic linear solver.
Detailed Description
The following stopping criteria are added in addition to an abstract base class:
MaxIterationsStopCrit
: converge after a maximum number of iterationsResidualNormStopCrit
: converge for a sufficiently small residual normPosteriorContractionStopCrit
: converge for sufficiently small trace of the posterior covarianceRelated Issues and PRs
PR is part of #51 and supersedes part of #283.