AutoPreconditionedConjugateGradient

class itergp.methods.AutoPreconditionedConjugateGradient(precond_iter, precond_policy=<itergp.methods.policies.UnitVectorPolicy object>, maxiter=None, atol=1e-06, rtol=1e-06)

Bases: ProbabilisticLinearSolver

Auto-Preconditioned Conjugate Gradient method.

Linear solver which initially chooses actions from a precond_policy and then constructs a preconditioner from the collected information to take preconditioned gradient actions afterwards.

Parameters
  • precond_iter – Number of iterations to use for preconditioner construction. Equivalently, the rank of the low-rank component of the preconditioner (inverse).

  • precond_policy – Policy to use for the first precond_size iterations, which determines the constructed preconditioner. Defaults to a UnitVectorPolicy, which is equivalent to preconditioning with a partial Cholesky factorization.

  • maxiter – Maximum number of steps the solver should take. Defaults \(10n\), where \(n\) is the size of the linear system.

  • atol – Absolute tolerance.

  • rtol – Relative tolerance.

Methods Summary

solve(prior, problem[, rng])

Solve the linear system.

solve_iterator(prior, problem[, rng])

Generator implementing the solver iteration.

Methods Documentation

solve(prior, problem, rng=None)

Solve the linear system.

Parameters
Returns

  • belief – Posterior belief \((\mathsf{x}, \mathsf{A}, \mathsf{H}, \mathsf{b})\) over the solution \(x\), the system matrix \(A\), its (pseudo-)inverse \(H=A^\dagger\) and the right hand side \(b\).

  • solver_state – Final state of the solver.

Return type

Tuple[LinearSystemBelief, LinearSolverState]

solve_iterator(prior, problem, rng=None)

Generator implementing the solver iteration.

This function allows stepping through the solver iteration one step at a time and exposes the internal solver state.

Parameters
Yields

solver_state – State of the probabilistic linear solver.

Return type

Generator[LinearSolverState, None, None]