Skip to content

cagpjax.policies.base

Classes:

AbstractBatchLinearSolverPolicy

Bases: AbstractLinearSolverPolicy

Abstract base class for policies that produce action matrices.

Methods:

  • to_actions

    Compute all actions used to solve the linear system \(Ax=b\).

to_actions abstractmethod

to_actions(A: LinearOperator, *, key: PRNGKeyArray | None = None) -> LinearOperator

Compute all actions used to solve the linear system \(Ax=b\).

For a matrix \(A\) with shape (n, n), the action matrix has shape (n, n_actions).

Parameters:

  • A

    (LinearOperator) –

    Linear operator representing the linear system.

  • key

    (PRNGKeyArray | None, default: None ) –

    Optional random key used by stochastic policies.

Returns:

Source code in src/cagpjax/policies/base.py
@abc.abstractmethod
def to_actions(
    self, A: LinearOperator, *, key: PRNGKeyArray | None = None
) -> LinearOperator:
    r"""Compute all actions used to solve the linear system $Ax=b$.

    For a matrix $A$ with shape ``(n, n)``, the action matrix has shape
    ``(n, n_actions)``.

    Args:
        A: Linear operator representing the linear system.
        key: Optional random key used by stochastic policies.

    Returns:
        Linear operator representing the action matrix.
    """
    ...

AbstractLinearSolverPolicy

Bases: Module

Abstract base class for all linear solver policies.

Policies define actions used to solve a linear system \(A x = b\), where \(A\) is a square linear operator.