Power Method
Power iteration for estimating the largest eigenvalue of an operator.
torchlinops.alg.power_method
power_method(
A: Callable[[Tensor], Tensor],
v_init: Tensor,
max_iters: int = 50,
eps: float = 0.0,
tol: float = 1e-05,
dim: Optional[int | Tuple] = None,
tqdm_kwargs: Optional[dict] = None,
) -> tuple[Tensor, Tensor]
Estimate the largest eigenvalue (in magnitude) of \(A\) via the power method.
Repeatedly applies \(v \leftarrow A(v) / \|A(v)\|\) until the eigenvalue estimate converges or max_iters is reached.
| PARAMETER | DESCRIPTION |
|---|---|
A
|
Function implementing the matrix-vector product \(A(v)\). \(A\) should be a square (normal) operator. |
v_init
|
Initial vector. Should be nonzero.
TYPE:
|
max_iters
|
Maximum number of power iterations.
TYPE:
|
eps
|
Small constant added to norms to avoid division by zero.
TYPE:
|
tol
|
Relative convergence tolerance on the eigenvalue estimate.
TYPE:
|
dim
|
If not |
tqdm_kwargs
|
Extra keyword arguments forwarded to
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
v
|
The estimated eigenvector (unit norm).
TYPE:
|
eigenvalue
|
The estimated eigenvalue \(\|A(v)\|\).
TYPE:
|