Linear Algebra
audio_samples.linalg holds non-negative least squares, the pseudo-inverse, the symmetric eigenproblem and the singular value decomposition.
Dense linear algebra: non-negative least squares, the pseudo-inverse, the symmetric eigenproblem and the SVD.
- audio_samples.linalg.eigh(a)
Eigenvalues and eigenvectors of a symmetric matrix; only the lower triangle is read.
- Parameters:
a (
array_like) –(n, n)symmetric matrix.- Returns:
Increasing eigenvalues, and the matching eigenvectors in the columns, both
float64.- Return type:
- audio_samples.linalg.nnls(A, B, *, max_iter=200, tol=1e-05)
Non-negative least squares:
min ||A x - B||withx >= 0.A 1-D
Bgets the exact active-set solution. Each column of a 2-D or higherBstarts from the pseudo-inverse solution with negative entries set to zero and is refined by coordinate descent, which keeps it near the minimum-norm solution whenAhas more columns than rows.- Parameters:
- Returns:
(n,)or(..., n, t), ofB’s precision.- Return type:
- Raises:
ValueError – Dimensions disagree or an input is not finite.
- audio_samples.linalg.pinv(a, *, rcond=1e-15)
The Moore-Penrose pseudo-inverse.
- Parameters:
a (
array_like) –(m, n)matrix.rcond (float) – Singular values below this fraction of the largest count as zero. Values below about 1.5e-8 act as that limit. Default 1e-15.
- Returns:
(n, m), ofa’s precision.- Return type:
- audio_samples.linalg.svd(a, *, k=None, n_iter=4, seed=0)
Thin singular value decomposition, or the truncated one with
k.Computed through the Gram matrix: singular values below about 1.5e-8 of the largest are reported as zero. The truncated form finds the leading triplets by randomised range finding, deterministically for a given
seed.- Parameters:
- Returns:
u,s,vt,float64.- Return type: