cagpjax.policies.lanczos
Lanczos-based policies.
Classes:
-
LanczosPolicy–Lanczos-based policy for eigenvalue decomposition approximation.
LanczosPolicy
LanczosPolicy(n_actions: int | None, key: PRNGKeyArray | None = None, grad_rtol: float | None = 0.0)
Bases: AbstractBatchLinearSolverPolicy
Lanczos-based policy for eigenvalue decomposition approximation.
This policy uses the Lanczos algorithm to compute the top n_actions eigenvectors
of the linear operator \(A\).
Attributes:
-
n_actions(int) –Number of Lanczos vectors/actions to compute.
-
key(PRNGKeyArray | None) –Random key for reproducible Lanczos iterations.
Initialize the Lanczos policy.
Parameters:
-
(n_actionsint | None) –Number of Lanczos vectors to compute.
-
(keyPRNGKeyArray | None, default:None) –Random key for initialization.
-
(grad_rtolfloat | None, default:0.0) –Specifies the cutoff for similar eigenvalues, used to improve gradient computation for (almost-)degenerate matrices. If not provided, the default is 0.0. If None or negative, all eigenvalues are treated as distinct. (see
cagpjax.linalg.eighfor more details)
Methods:
-
to_actions–Compute action matrix.
Source code in src/cagpjax/policies/lanczos.py
to_actions
Compute action matrix.
Parameters:
-
(ALinearOperator) –Symmetric linear operator representing the linear system.
Returns:
-
LinearOperator–Linear operator containing the Lanczos vectors as columns.