<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Linear Algebra on Chen Kai Blog</title><link>https://www.chenk.top/en/linear-algebra/</link><description>Recent content in Linear Algebra on Chen Kai Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 30 Apr 2025 09:00:00 +0000</lastBuildDate><atom:link href="https://www.chenk.top/en/linear-algebra/index.xml" rel="self" type="application/rss+xml"/><item><title>Essence of Linear Algebra (18): Frontiers and Summary</title><link>https://www.chenk.top/en/linear-algebra/18-frontiers-and-summary/</link><pubDate>Wed, 30 Apr 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/18-frontiers-and-summary/</guid><description>&lt;p>We have walked the long road of linear algebra together. We started with arrows in the plane and ended at the gates of quantum computers, the inner workings of large language models, and the topology of data clouds. The remarkable thing &amp;ndash; the thing this series has tried to make visible &amp;ndash; is that the same handful of ideas keeps coming back. A vector is a state. A matrix is a transformation. A decomposition is the structure hiding inside the transformation. A norm tells you when you can trust your computation. Once you internalise that loop, every &amp;ldquo;frontier&amp;rdquo; looks less like a foreign country and more like another dialect of a language you already speak.&lt;/p></description></item><item><title>Essence of Linear Algebra (17): Linear Algebra in Computer Vision</title><link>https://www.chenk.top/en/linear-algebra/17-linear-algebra-in-computer-vision/</link><pubDate>Wed, 23 Apr 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/17-linear-algebra-in-computer-vision/</guid><description>&lt;p>Computer vision is the science of teaching machines to see. What is striking is how thoroughly the whole field reduces to linear algebra: an image is a matrix, a geometric transformation is a matrix product, a camera is a $3 \times 4$ projection matrix, two-view geometry is the equation $\mathbf{x}_2^\top \mathbf{F}\, \mathbf{x}_1 = 0$, and 3D reconstruction is a sparse linear least-squares problem. Once you see the field through that lens, what once looked like a zoo of algorithms turns out to be a small set of linear-algebraic ideas applied repeatedly.&lt;/p></description></item><item><title>Essence of Linear Algebra (16): Linear Algebra in Deep Learning</title><link>https://www.chenk.top/en/linear-algebra/16-linear-algebra-in-deep-learning/</link><pubDate>Wed, 16 Apr 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/16-linear-algebra-in-deep-learning/</guid><description>&lt;p>Strip away the marketing and a deep network is one thing: a long pipeline of matrix multiplications glued together by elementwise nonlinearities. Forward pass, backward pass, convolution, attention, normalization, fine-tuning &amp;ndash; every &amp;ldquo;trick&amp;rdquo; is a small twist on the same algebraic theme. Once you see the matrices, the field stops looking like a bag of recipes and starts looking like a single language.&lt;/p>
&lt;p>This chapter rebuilds the modern stack from that single language. We follow one signal &amp;ndash; a vector $\mathbf{x}$ &amp;ndash; as it flows through linear layers, gets convolved, gets attended to, gets normalized, and gets adapted by a low-rank update. At each step we name the matrix that does the work and the property of that matrix (rank, conditioning, transpose) that makes the trick succeed.&lt;/p></description></item><item><title>Essence of Linear Algebra (15): Linear Algebra in Machine Learning</title><link>https://www.chenk.top/en/linear-algebra/15-linear-algebra-in-machine-learning/</link><pubDate>Wed, 09 Apr 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/15-linear-algebra-in-machine-learning/</guid><description>&lt;p>Ask any senior ML engineer &amp;ldquo;what math do you actually use day to day?&amp;rdquo; and the answer is almost always &lt;strong>linear algebra&lt;/strong>. Calculus shows up in derivations; probability shows up in modeling; but the runtime of a real ML system is dominated by matrix-vector multiplies, decompositions, and projections. PyTorch&amp;rsquo;s &lt;code>Linear&lt;/code>, scikit-learn&amp;rsquo;s &lt;code>PCA&lt;/code>, Spark MLlib&amp;rsquo;s &lt;code>ALS&lt;/code>, and a Transformer&amp;rsquo;s attention head are all the same primitive in different costumes.&lt;/p>
&lt;p>This chapter walks through the algorithms that production ML systems actually run &amp;ndash; PCA, LDA, SVM with kernels, matrix factorization for recommenders, regularized linear regression, neural network layers, attention &amp;ndash; and shows the linear algebra that makes each of them tick. We focus on intuition first, geometry second, formulas third.&lt;/p></description></item><item><title>Essence of Linear Algebra (14): Random Matrix Theory</title><link>https://www.chenk.top/en/linear-algebra/14-random-matrix-theory/</link><pubDate>Wed, 02 Apr 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/14-random-matrix-theory/</guid><description>&lt;p>A million i.i.d. coin flips, arranged into a thousand-by-thousand symmetric matrix, somehow produce eigenvalues that fill a perfect semicircle. A noisy sample covariance matrix that should be the identity instead spreads its eigenvalues across an interval whose width you can predict before seeing a single number. The largest eigenvalue of a Wigner matrix has a tail distribution that turns up everywhere &amp;ndash; in growing crystals, in the longest increasing subsequence of a random permutation, in the energy levels of heavy nuclei. &lt;strong>Random matrix theory&lt;/strong> (RMT) is the study of why these regularities appear, and how to use them.&lt;/p></description></item><item><title>Essence of Linear Algebra (13): Tensors and Multilinear Algebra</title><link>https://www.chenk.top/en/linear-algebra/13-tensors-and-multilinear-algebra/</link><pubDate>Wed, 26 Mar 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/13-tensors-and-multilinear-algebra/</guid><description>&lt;p>If you&amp;rsquo;ve used PyTorch or TensorFlow, you&amp;rsquo;ve met the word &amp;ldquo;tensor&amp;rdquo; hundreds of times. PyTorch calls every array &lt;code>torch.Tensor&lt;/code>; TensorFlow puts it in the product name. But what &lt;em>is&lt;/em> a tensor, and why did frameworks borrow this physics-flavored word for what looks like a multi-dimensional array?&lt;/p>
&lt;p>The short answer of this chapter:&lt;/p>
&lt;blockquote>
&lt;p>A tensor is the natural generalization of a scalar, vector, and matrix to &lt;strong>arbitrary&lt;/strong> dimensions. Everything you know about matrices either lifts cleanly to tensors, or breaks in instructive ways.&lt;/p></description></item><item><title>Sparse Matrices and Compressed Sensing -- Less Is More</title><link>https://www.chenk.top/en/linear-algebra/12-sparse-matrices-and-compressed-sensing/</link><pubDate>Wed, 19 Mar 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/12-sparse-matrices-and-compressed-sensing/</guid><description>&lt;h2 id="the-less-is-more-miracle">The &amp;ldquo;Less Is More&amp;rdquo; Miracle&lt;/h2>
&lt;p>A raw 24-megapixel photograph weighs in at roughly 70 MB. JPEG compresses it to a few hundred kilobytes &amp;ndash; a 100$\times$reduction &amp;ndash; and you cannot tell the difference. A traditional MRI scan takes thirty minutes; a modern compressed sensing MRI gets the same image in five.&lt;/p>
&lt;p>Both miracles run on the same engine: &lt;strong>sparsity&lt;/strong>. Most natural signals, written in the right basis, have only a handful of meaningful coefficients. Everything else is essentially zero.&lt;/p></description></item><item><title>Matrix Calculus and Optimization -- The Engine Behind Machine Learning</title><link>https://www.chenk.top/en/linear-algebra/11-matrix-calculus-and-optimization/</link><pubDate>Wed, 12 Mar 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/11-matrix-calculus-and-optimization/</guid><description>&lt;h2 id="from-shower-knobs-to-neural-networks">From Shower Knobs to Neural Networks&lt;/h2>
&lt;p>Every morning you train a tiny neural network. The water comes out too cold, so you nudge the knob &amp;ndash; a &lt;em>parameter&lt;/em> &amp;ndash; in some direction. A second later you observe a new temperature &amp;ndash; the &lt;em>error signal&lt;/em> &amp;ndash; and nudge again. After three or four iterations you have converged.&lt;/p>
&lt;p>Modern deep learning is the same loop, scaled up by seven orders of magnitude. The &amp;ldquo;knob&amp;rdquo; is a matrix$W$with hundreds of millions of entries. The &amp;ldquo;error&amp;rdquo; is a scalar loss$L$. And the question is the same: &lt;strong>for each parameter, in which direction should I push, and by how much?&lt;/strong> The answer lives in a single object: the gradient$\partial L / \partial W$.&lt;/p></description></item><item><title>Matrix Norms and Condition Numbers -- Is Your Linear System Healthy?</title><link>https://www.chenk.top/en/linear-algebra/10-matrix-norms-and-condition-numbers/</link><pubDate>Wed, 05 Mar 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/10-matrix-norms-and-condition-numbers/</guid><description>&lt;h2 id="the-question-that-haunts-engineers">The Question That Haunts Engineers&lt;/h2>
&lt;p>The equations are right. The algorithm is right. So why is the computed answer completely wrong?&lt;/p>
&lt;p>The culprit is usually a single number called the &lt;strong>condition number&lt;/strong>. It measures how &lt;em>sensitive&lt;/em> a linear system is — whether a tiny wobble in the input gets amplified into a catastrophic error in the output. To talk about condition numbers we first need a way to measure the &amp;ldquo;size&amp;rdquo; of vectors and matrices. That is what norms do.&lt;/p></description></item><item><title>Singular Value Decomposition -- The Crown Jewel of Linear Algebra</title><link>https://www.chenk.top/en/linear-algebra/09-singular-value-decomposition/</link><pubDate>Wed, 26 Feb 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/09-singular-value-decomposition/</guid><description>&lt;h2 id="why-svd-earns-the-crown">Why SVD Earns the Crown&lt;/h2>
&lt;p>The spectral theorem of &lt;a href="https://www.chenk.top/en/chapter-08-symmetric-matrices-and-quadratic-forms/">Chapter 8&lt;/a>
 gave us $A = Q\Lambda Q^T$ &amp;ndash; a beautifully clean factorisation, but &lt;strong>only for symmetric matrices&lt;/strong>. Most matrices that show up in practice are not symmetric, and many are not even square:&lt;/p>
&lt;ul>
&lt;li>a photograph stored as a $1920 \times 1080$ pixel matrix,&lt;/li>
&lt;li>a Netflix-style user&amp;ndash;movie rating matrix (millions of rows, thousands of columns),&lt;/li>
&lt;li>a document&amp;ndash;term matrix in NLP (documents by vocabulary),&lt;/li>
&lt;li>a gene-expression matrix in bioinformatics.&lt;/li>
&lt;/ul>
$$A = U\,\Sigma\,V^{\!\top}.$$&lt;p>
This is the most powerful, most universally applicable decomposition in all of linear algebra.&lt;/p></description></item><item><title>Symmetric Matrices and Quadratic Forms -- The Best Matrices in Town</title><link>https://www.chenk.top/en/linear-algebra/08-symmetric-matrices-and-quadratic-forms/</link><pubDate>Wed, 19 Feb 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/08-symmetric-matrices-and-quadratic-forms/</guid><description>&lt;h2 id="why-symmetric-matrices-are-the-best">Why Symmetric Matrices Are the &amp;ldquo;Best&amp;rdquo;&lt;/h2>
&lt;p>Of all the matrices you will ever meet, &lt;strong>symmetric matrices&lt;/strong> are the most well-behaved. They have:&lt;/p>
&lt;ul>
&lt;li>only &lt;strong>real&lt;/strong> eigenvalues,&lt;/li>
&lt;li>a complete set of &lt;strong>orthogonal&lt;/strong> eigenvectors,&lt;/li>
&lt;li>and a &lt;strong>perfect diagonalization&lt;/strong> $A = Q\Lambda Q^T$ that costs nothing to invert.&lt;/li>
&lt;/ul>
&lt;p>This is not a curiosity. Almost every important matrix you actually compute with in physics, optimization, statistics, or machine learning is symmetric:&lt;/p>
&lt;ul>
&lt;li>A &lt;strong>covariance matrix&lt;/strong> $\Sigma = \tfrac{1}{n}X^TX$ records how features vary together. It is symmetric by construction.&lt;/li>
&lt;li>A &lt;strong>Hessian matrix&lt;/strong> $H_{ij} = \partial^2 f / \partial x_i \partial x_j$ records second derivatives. By Clairaut&amp;rsquo;s theorem, mixed partials commute, so $H$ is symmetric.&lt;/li>
&lt;li>A &lt;strong>stiffness matrix&lt;/strong> $K$ encodes how connected springs push on each other. Newton&amp;rsquo;s third law forces $K = K^T$.&lt;/li>
&lt;li>A &lt;strong>kernel&lt;/strong> or &lt;strong>Gram matrix&lt;/strong> $G_{ij} = \langle x_i, x_j \rangle$ measures pairwise similarity. Inner products are symmetric, so $G$ is too.&lt;/li>
&lt;/ul>
&lt;p>This chapter explains why symmetry buys you so much, and how the geometry of &lt;strong>quadratic forms&lt;/strong> lets you read off the behaviour of a symmetric matrix at a glance.&lt;/p></description></item><item><title>Orthogonality and Projections -- When Vectors Mind Their Own Business</title><link>https://www.chenk.top/en/linear-algebra/07-orthogonality-and-projections/</link><pubDate>Wed, 12 Feb 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/07-orthogonality-and-projections/</guid><description>&lt;h2 id="why-orthogonality-matters">Why Orthogonality Matters&lt;/h2>
&lt;p>Two vectors are &lt;strong>orthogonal&lt;/strong> when they &amp;ldquo;do not interfere&amp;rdquo; with one another. That single idea &amp;ndash; one direction tells you nothing about the other &amp;ndash; powers GPS positioning, noise-canceling headphones, JPEG compression, recommendation systems, and most of numerical linear algebra.&lt;/p>
&lt;p>Orthogonality is the single biggest computational shortcut in linear algebra. With a generic basis, finding coordinates is solving a linear system. With an &lt;strong>orthogonal&lt;/strong> basis, finding coordinates is one dot product per axis. Hard problem, easy problem, same problem &amp;ndash; just a better basis.&lt;/p></description></item><item><title>Eigenvalues and Eigenvectors</title><link>https://www.chenk.top/en/linear-algebra/06-eigenvalues-and-eigenvectors/</link><pubDate>Wed, 05 Feb 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/06-eigenvalues-and-eigenvectors/</guid><description>&lt;h2 id="the-big-question">The Big Question&lt;/h2>
&lt;p>Apply a matrix to a vector and almost anything can happen. Most vectors get rotated &lt;em>and&lt;/em> stretched, landing in a brand new direction. But scattered among them are a few special vectors that refuse to leave their span. They come out of the transformation pointing exactly the way they went in &amp;ndash; only longer, shorter, or flipped.&lt;/p>
&lt;p>These survivors are &lt;strong>eigenvectors&lt;/strong>. The factor by which they get scaled is the &lt;strong>eigenvalue&lt;/strong>.&lt;/p></description></item><item><title>Linear Systems and Column Space</title><link>https://www.chenk.top/en/linear-algebra/05-linear-systems-and-column-space/</link><pubDate>Wed, 29 Jan 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/05-linear-systems-and-column-space/</guid><description>&lt;h2 id="the-central-question">The Central Question&lt;/h2>
&lt;p>Almost everything in applied mathematics eventually lands on the same question:&lt;/p>
&lt;blockquote>
&lt;p>Given a matrix $A$ and a vector $\vec{b}$, does the equation $A\vec{x} = \vec{b}$ have a solution? If so, how many?&lt;/p>
&lt;/blockquote>
&lt;p>The mechanical answer is &amp;ldquo;row-reduce and look.&amp;rdquo; The &lt;em>structural&lt;/em> answer is far more interesting &amp;ndash; and it is the goal of this chapter. Three geometric objects tell you everything:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Column space&lt;/strong> $C(A)$ &amp;ndash; the set of vectors $A$ can reach. It decides &lt;strong>whether&lt;/strong> a solution exists.&lt;/li>
&lt;li>&lt;strong>Null space&lt;/strong> $N(A)$ &amp;ndash; the set of vectors $A$ crushes to zero. It decides &lt;strong>how many&lt;/strong> solutions exist.&lt;/li>
&lt;li>&lt;strong>Rank&lt;/strong> $r$ &amp;ndash; the dimension of the column space. It quantifies how much information $A$ preserves.&lt;/li>
&lt;/ul>
&lt;p>Once these three are clear, every linear-systems result &amp;ndash; existence, uniqueness, least squares, the four fundamental subspaces &amp;ndash; becomes the same story told from different angles.&lt;/p></description></item><item><title>The Secrets of Determinants</title><link>https://www.chenk.top/en/linear-algebra/04-the-secrets-of-determinants/</link><pubDate>Wed, 22 Jan 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/04-the-secrets-of-determinants/</guid><description>&lt;h2 id="beyond-the-formula">Beyond the Formula&lt;/h2>
&lt;p>In most classrooms, determinants are introduced as a formula to memorize:&lt;/p>
$$\det\begin{pmatrix}a &amp; b\\ c &amp; d\end{pmatrix} = ad - bc$$&lt;p>You plug in numbers, compute, and move on. That misses the point entirely.&lt;/p>
&lt;p>Here is the real meaning, in one sentence:&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>The determinant of $A$ is the factor by which $A$ scales area (in 2D) or volume (in 3D).&lt;/strong>&lt;/p>
&lt;/blockquote>
&lt;p>Once you internalize this, every property of determinants stops being a rule to memorize and starts being something you can &lt;em>see&lt;/em>. The product rule $\det(AB) = \det(A)\det(B)$ becomes obvious &amp;ndash; two scalings compose multiplicatively. $\det(A) = 0$ means space gets crushed flat. $\det(A^{-1}) = 1/\det(A)$ says the inverse must undo the scaling. The sign of the determinant tells you whether orientation was preserved or flipped.&lt;/p></description></item><item><title>Matrices as Linear Transformations</title><link>https://www.chenk.top/en/linear-algebra/03-matrices-as-linear-transformations/</link><pubDate>Wed, 15 Jan 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/03-matrices-as-linear-transformations/</guid><description>&lt;h2 id="the-big-idea">The Big Idea&lt;/h2>
&lt;p>Open a traditional textbook and matrices show up as &amp;ldquo;rectangular arrays of numbers.&amp;rdquo; You learn rules for adding and multiplying them, but no one explains &lt;em>why&lt;/em> the multiplication rule looks the way it does, or why $AB \neq BA$ in general.&lt;/p>
&lt;p>Here is the secret the symbol-pushing version hides: &lt;strong>a matrix is a function that transforms space.&lt;/strong> Every $m \times n$ matrix is a machine that eats an $n$-dimensional vector and spits out an $m$-dimensional one. Once you can &lt;em>see&lt;/em> that, the strange rules stop being strange. They are simply the bookkeeping for what happens to the basis vectors.&lt;/p></description></item><item><title>Linear Combinations and Vector Spaces</title><link>https://www.chenk.top/en/linear-algebra/02-linear-combinations-and-vector-spaces/</link><pubDate>Wed, 08 Jan 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/02-linear-combinations-and-vector-spaces/</guid><description>&lt;h2 id="why-this-chapter-matters">Why This Chapter Matters&lt;/h2>
&lt;p>Open a box of crayons that contains only &lt;strong>red, green, and blue&lt;/strong>. How many colors can you draw? The honest answer is &lt;strong>infinitely many&lt;/strong> — every shade you have ever seen on a screen is just a different mix of those three. Three &amp;ldquo;ingredients&amp;rdquo; produce an entire universe.&lt;/p>
&lt;p>That recipe — &lt;em>take a few vectors, scale them, add them up&lt;/em> — is called a &lt;strong>linear combination&lt;/strong>. The whole of linear algebra is built on this one move. Once you understand it deeply, you also understand:&lt;/p></description></item><item><title>The Essence of Vectors -- More Than Just Arrows</title><link>https://www.chenk.top/en/linear-algebra/01-the-essence-of-vectors/</link><pubDate>Wed, 01 Jan 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/01-the-essence-of-vectors/</guid><description>&lt;h2 id="why-vectors-and-why-care">Why Vectors, and Why Care?&lt;/h2>
&lt;p>A physicist talks about a &lt;em>force&lt;/em>. A data scientist talks about a &lt;em>feature&lt;/em>. A game programmer talks about a &lt;em>velocity&lt;/em>. A quantum theorist talks about a &lt;em>state&lt;/em>. Different worlds, different languages &amp;ndash; but the same underlying object: &lt;strong>a vector&lt;/strong>.&lt;/p>
&lt;p>That is not a coincidence. A vector is the smallest piece of mathematics flexible enough to describe &lt;strong>anything you can add together and scale&lt;/strong>. Once you spot that pattern, you spot it everywhere.&lt;/p></description></item></channel></rss>