RandomUnitVectorPolicy¶
- class probnum.linalg.solvers.policies.RandomUnitVectorPolicy(probabilities='uniform', replace=True)¶
Bases:
LinearSolverPolicy
Policy returning randomly drawn standard unit vectors.
Draw a standard unit vector \(e_i\) at random and return it. This policy corresponds to selecting columns of the matrix as observations.
- Parameters:
probabilities (str) – Probabilities with which to choose different columns. Either uniform or rownorm.
replace – Whether to sample with or without replacement.
Methods Summary
__call__
(solver_state[, rng])Return an action for a given solver state.
Methods Documentation
- __call__(solver_state, rng=None)[source]¶
Return an action for a given solver state.
- Parameters:
solver_state (LinearSolverState) – Current state of the linear solver.
rng (Generator | None) – Random number generator.
- Returns:
Next action to take.
- Return type:
action