math.py π§ΒΆ
Source: LION/utils/math.py
Warning
This file has not yet received a complete narrative and docstring audit. Its public source-level API is listed automatically below.
Utility math functions.
- power_method(op: Operator, maxiter: int = 100, tol: float = 1e-06, device: torch.device | str | None = None) torch.Tensor
Estimate operator norm by power iteration using torch.
Parameters βββ- op : Operator The operator for which to estimate the norm. maxiter : int Number of power iterations. tol : float Absolute tolerance for convergence. (TODO: consider adding relative tolerance?) device : torch.device | str | None Device for computations. If None, use operatorβs device.
Returns ββ- sigma : torch.Tensor Estimated operator norm.
- test_convexity(net, x, device)
No docstring is available.