gpflow.models.cglb#
Classes#
gpflow.models.cglb.NystromPreconditioner#
Functions#
gpflow.models.cglb.cglb_conjugate_gradient#
- gpflow.models.cglb.cglb_conjugate_gradient(K, b, initial, preconditioner, cg_tolerance, max_steps, restart_cg_step)[source]#
Conjugate gradient algorithm used in CGLB model. The method of conjugate gradient (Hestenes and Stiefel, 1952) produces a sequence of vectors
such that = initial, and (in exact arithmetic) . In practice, the v_i often converge quickly to approximate , and the algorithm can be stopped without running N iterations.We assume the preconditioner,
, satisfies , and stop the algorithm when satisfies .- Parameters
K (
Union
[ndarray
[Any
,Any
],Tensor
,Variable
,Parameter
]) – Matrix we want to backsolve from. Must be PSD. Shape [N, N].b (
Union
[ndarray
[Any
,Any
],Tensor
,Variable
,Parameter
]) – Vector we want to backsolve. Shape [B, N].initial (
Union
[ndarray
[Any
,Any
],Tensor
,Variable
,Parameter
]) – Initial vector solution. Shape [N].preconditioner (
NystromPreconditioner
) – Preconditioner function.cg_tolerance (
float
) – Expected maximum error. This value is used as a decision boundary against stopping criteria.max_steps (
int
) – Maximum number of CG iterations.restart_cg_step (
int
) – Restart step at which the CG resets the internal state to the initial position using the currect solution vector . Can help avoid build up of numerical errors.
- Return type
Tensor
- Returns
v where v approximately satisfies
.