-
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] ProbabilisticLinearSolverState
, LinearSystemBelief
and LinearSolverPolicy
#460
[PLS Refactor] ProbabilisticLinearSolverState
, LinearSystemBelief
and LinearSolverPolicy
#460
Conversation
…to linsolve-policy
LinearSolverState
, LinearSystemBelief
and LinearSolverPolicy
LinearSolverState
, LinearSystemBelief
and ProbabilisticLinearSolverPolicy
LinearSolverState
, LinearSystemBelief
and ProbabilisticLinearSolverPolicy
ProbabilisticLinearSolverState
, LinearSystemBelief
and LinearSolverPolicy
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.
Nice :)
@property | ||
def residuals(self) -> Tuple[np.ndarray, ...]: | ||
r"""Residuals :math:`\{Ax_i - b\}_i`.""" | ||
return tuple(self._residuals) |
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.
This might be nasty for an outside user, since it is not really transparent when the residuals are None
and when they are np.ndarray
.
I think it's fine for now though.
src/probnum/problems/_problems.py
Outdated
@@ -194,6 +194,26 @@ class LinearSystem: | |||
# For testing and benchmarking | |||
solution: Optional[Union[np.ndarray, randvars.RandomVariable]] = None | |||
|
|||
@classmethod | |||
def from_matrix( |
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.
I think I would prefer the random_linear_system
, but don't feel obliged to change things if this causes inconvenience.
In a Nutshell
First components for the new compositional structure of the
ProbabilisticLinearSolver
. Will be followed up with more PRs adding the remaining components.Detailed Description
This PR begins the refactoring of the probabilistic linear solver into a compositional pattern and adds the following component classes:
LinearSystemBelief
ProbabilisticLinearSolverState
LinearSolverPolicy
, incl. sub-classes implementing a random and deterministic policyIt also restructures the
probnum.linalg
API reference into a more understandable hierarchy in line with the module and semantic structure.Note that this PR leaves the original implementation intact until all components of the new solver are included.
Related Issues
First part of #51 and supersedes part of #283.