flâneur — a map of the web's best reading

Matrix Singular Value Decomposition (SVD) Using the Jacobi Algorithm from Scratch JavaScript | James D. McCaffrey

jamesmccaffrey.wordpress.com · 3,235 words · saved by 1 readers

If you have a matrix A and apply singular value decomposition (SVD) to it, you get a matrix U, a vector s, and a matrix Vh so that A = U * S * Vh where S is a matrix with the elements of vector s on the diagonal. Writing a function to compute SVD is extremely difficult and there are several algorithms. A few weeks ago I implemented a from-scratch SVD version using raw JavaScript, but I wasn’t at all happy with it — it just didn’t feel right. See https://jamesmccaffrey.wordpress.com/2023/11/21/matrix-singular-value-decomposition-svd-from-scratch-using-javascript/. So, one evening on an Alaska Airlines flight from Minneapolis to Seattle, I decided to refactor the GNU Scientific Library (GSL) function gsl_linalg_SV_decomp_jacobi() from C to JavaScript. I did so but only after many hours of effort. The GSL version is at github.com/ampl/gsl/blob/master/linalg/svd.c and is called the Jacobi algorithm version of SVD. Most of my time was spent on implementing a lot of JavaScript helper functio

Matrix Singular Value Decomposition (SVD) Using the Jacobi Algorithm from Scratch JavaScript - James D. McCaffreyJames D. McCaffrey James D. McCaffrey Software Research, Development, Testing, and Education Skip to content Home About Me Publications Recent Technical Journals Books and e-Books Research Papers Old Publications Archive ← “Microsoft Stirs Interest with Small, Fine-Tuned Orca-2 LLM” on the Pure AI Web Site Schur Decomposition Using the QR Algorithm → Matrix Singular Value Decomposition (SVD) Using the Jacobi Algorithm from Scratch JavaScript Posted on January 5

Explore this link on the map →

saved by

related reading