The big six matrix factorizations
nhigham.com
nhigham.com
Application 1 - spectral clustering - an alternative to k-means for nonlinear clusters. Get a Distance matrix of your data, spectral decomp, run k-means on your k top eigen vectors and that's your clusters.
Application 2 - graph clustering - (run spectral clustering on adj matrix!)
There's some tricks to getting it to work in practice like normalizing but it's a simple and powerful method. Also the matrices can get big so it helps a lot to use sparse matrix libraries for the computations.
[1] https://towardsdatascience.com/spectral-clustering-aba2640c0....
But the way I see it "spectral decomposition of A" is a way to express A as a sum of orthogonal, rank-1, operators. A = \sum l_i u_i u_i^T. Those l_i are the eigenvalues; u_i are the eigenvectors.
The eigenvectors look a whole lot like the "modes" in a Fourier decomposition. And if you plot (i, l_i), the eigenvalues are a bit like the "spectrum" (the amplitude of each mode).
In fact, the complex exponentials (the modes in the Fourier decomposition) are also eigenvectors of a specific operator (the Laplacian).
Math people are good at finding connections between things.
https://ocw.mit.edu/courses/18-06sc-linear-algebra-fall-2011...
My goal is to learn the math behind machine learning.
Book: Mathematics for Machine Learning (mml-book.github.io) https://news.ycombinator.com/item?id=16750789
Mathematics for Machine Learning [pdf] (mml-book.com) https://news.ycombinator.com/item?id=21293132
Mathematics of Machine Learning (2016) (ibm.com) https://news.ycombinator.com/item?id=15146746
https://ocw.mit.edu/courses/18-065-matrix-methods-in-data-an...
[1] https://smile.amazon.com/Probabilistic-Machine-Learning-Intr...
It covers almost all the math you'd need to start doing ML research. I find it to be the ideal 'one book to rule them all' book for CS people in ML. Although, pure math grads in ML might find the book to not go deep enough.
For most current gen deep learning there's not even that much math, it's mostly a growing library of what are basically engineering tricks. For example an LSTM is almost exclusively very basic linear algebra with some calculus used to optimize it. But by it's nature the calculus can't be done by hand and the actual implementation of all that basic linear algebra is tricky and takes practice.
You'll learn more by implementing things from scratch based on the math than you will trying to read through all the background material hoping that one day it will all make sense. It only ever makes sense when implementing and by continuous reading/practice.
The SVD is everywhere. IIRC, the first Netflix price was one won with the SVD:
https://en.wikipedia.org/wiki/Netflix_Prize
https://cseweb.ucsd.edu/classes/fa17/cse291-b/reading/Progre...
I suppose “flops” means “floating-point operations” here? Heretofore I’ve always encountered this as an abbreviation for “floating-point operations per second”.
Flop/s makes no sense and is outright wrong. The whole point of flops is to express how many floating point operations are required by an algorithm. How many operations are performed per second is a property of the hardware you're using to run an implementation of the algorithm.
You want to express computational complexity in terms of floating point operations.
I couldn't confirm the DR SVD part, but the PROF SVD story appears to be real: https://www.mathworks.com/company/newsletters/articles/profe...
[1] http://www.stat.uchicago.edu/~lekheng/courses/309f14/flops/v... and
I'm aware of randomized algorithms with better complexity, which come at the cost of only giving approximate results (though the approximation may be perfectly good for practical purposes). See e.g. [1]. Are there other approaches?
(of course, it's not so clear cut, since robustness varies, not all methods are applicable, and the benchmark is for solving the system, not computing the decomposition, but overall, knowledge of which decomposition is fast and which is not is absolutely crucial to practitioners)
[1]: https://eigen.tuxfamily.org/dox/group__DenseDecompositionBen...
For example, the SVD (Golub-Kahan-Reinsch) method generally involves bidiagonalisation of the matrix and then implicit QR steps, which are often achieved with Householder reflections and Givens rotations. Sure, all of those are conceptually matrix multiplications, but they're not implemented as O(N^3) matrix multiplications; rather, their special structure is exploited so that they're faster. Yet, the entire algorithm is still cubic. So not sure Strassen would accelerate things.
> The terms “factorization” and “decomposition” are synonymous and it is a matter of convention which is used. Our list comprises three factorization and three decompositions.
I can't tell if this is a joke: right after saying that these two words mean the same thing in this context, they are then used to categorize the methods.
Edit: This is the kind of content that proves the "dead internet theory" is wrong.
It makes sense, the author is just using the original name of the method to bucket them e.g. spectral decomposition.
suggestion:
- 'factoring' is a multiplicative breakdown, a 'composition', like prime factorization.
- 'decomposition' could also be called 'partition', and is an additive breakdown, like how 3 could be split into 2 + 1
A = X D Y
with X,Y invertible and D diagonal. It's called rank decomposition, because you can read off the rank from A by counting the non-zero entries in D. It's also useful to determining bases for the image and the kernel of A. Every math student learns a version of that in their first lecture series of Linear Algebra.
Curiously, the rank decomposition is not covered in the numerical literature. Also it's not possible to derive a rank decomposition from LR, QR decomposition, although the underlying algorithms (Gauss, Gram-Schmidt) could be used to do so.
It took me multiple weeks of work, to understand what the problem with this algorithms is, and what the practical options are to establish a rank decomposition are. Full details are available on my blog:
https://www.heinrichhartmann.com/posts/2021-03-08-rank-decom...
TL;DR. Your options are (1) SVD, (2) QR factorization with column pivoting (part of LAPACK), (3) LDU factorization with total pivoting (not implemented in BLAS/LAPACK/etc.)
The question is: How do you compute them in an effective (avoiding full SVD) and stable way?
https://nhigham.com/2021/05/19/what-is-a-rank-revealing-fact...
This “rank decomposition” is a bit interesting algebraically rather than numerically, since then the numerical stability problems disappear. Also, if we take all matrices to be over the integers (and require that “invertible” means the inverse is also an integer matrix), then the rank decomposition is a lot like the Smith normal form of a matrix.
It's highly relevant from an algebraic perspective, hence it's curious that it's not covered (at all) in the numeric literature.
Granted, computing the dimensions of the kernel is not so easy, especially because a pair of vectors can be arbitrarily close without being linearly dependent. No wonder there is no stable way to do it, it technically exceeds the capability of finite-precision numbers. Multiplying a vector of unequal components by most numbers, especially those with non-terminating base-two decimal representations, will produce a vector that is linearly independent when rounded back to finite precision.
Clearly then, linear independence on computers has to be considered in the continuous sense in which singular values reveal it, where a very small singular value represents an "almost-kernel," which is the closest thing to a kernel you are likely to find outside of carefully constructed examples or integer matrices.
Well. Sometimes you want to know a solution to a problem and not only the dimension of the solution space : )
Also for composition: If you have "compatible" matrices B,C. How do you compute the restriction: A|_ker(B), A|_im(B) or co-restrictions (factor projections): A/ker(C), A/im(C), etc.
It was even coined one of the top 10 algorithm of the 20th century https://archive.siam.org/pdf/news/637.pdf
Bunch–Kaufman is the "right" factorization for indefinite Hermitian/symmetric matrices but it's not as well know.
But otherwise I agree, QR is almost better on every front.