cagpjax.policies.lanczos
Lanczos-based policies.
LanczosPolicy
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:
Name | Type | Description |
---|---|---|
n_actions |
int
|
Number of Lanczos vectors/actions to compute. |
key |
PRNGKeyArray | None
|
Random key for reproducible Lanczos iterations. |
Source code in src/cagpjax/policies/lanczos.py
__init__(n_actions, key=None)
Initialize the Lanczos policy.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_actions
|
int
|
Number of Lanczos vectors to compute. |
required |
key
|
PRNGKeyArray | None
|
Random key for initialization. |
None
|
Source code in src/cagpjax/policies/lanczos.py
to_actions(A)
Compute action matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
A
|
LinearOperator
|
Symmetric linear operator representing the linear system. |
required |
Returns:
Type | Description |
---|---|
LinearOperator
|
Linear operator containing the Lanczos vectors as columns. |