ConjugateGradientPolicy¶
- class probnum.linalg.solvers.policies.ConjugateGradientPolicy(reorthogonalization_fn_residual=None, reorthogonalization_fn_action=None)¶
Bases:
LinearSolverPolicy
Policy returning \(A\)-conjugate actions.
Selects the negative gradient / residual as an initial action \(s_0 = b - A x_0\) and then successively generates \(A\)-conjugate actions, i.e. the actions satisfy \(s_i^\top A s_j = 0\) iff \(i \neq j\).
- Parameters
reorthogonalization_fn_residual (Optional[Callable[[ndarray, Iterable[ndarray], LinearOperator], ndarray]]) – Reorthogonalization function, which takes a vector, an orthogonal basis and optionally an inner product and returns a reorthogonalized vector. If not None the residuals are reorthogonalized before the action is computed.
reorthogonalization_fn_action (Optional[Callable[[ndarray, Iterable[ndarray], LinearOperator], ndarray]]) – Reorthogonalization function, which takes a vector, an orthogonal basis and optionally an inner product and returns a reorthogonalized vector. If not None the computed action is reorthogonalized.
- Return type
None
Methods Summary
__call__
(solver_state[, rng])Return an action for a given solver state.
Methods Documentation
- __call__(solver_state, rng=None)[source]¶
Return an action for a given solver state.
- Parameters
solver_state (LinearSolverState) – Current state of the linear solver.
- Returns
Next action to take.
- Return type
action