木鸟杂记

大规模数据系统

Interesting Linear Algebra (Part 1): Matrix Multiplication

Since I always struggled to keep up with understanding the physical meaning of various matrix operations, despite multiple attempts to get into machine learning over the years, I was always turned away at the door. By chance, a colleague recommended MIT’s classic linear algebra open course. After listening to a few lectures, it was quite exhilarating; the previously tightly shut door seemed to open a crack.

Therefore, this series will share some interesting points from the course in each article. To avoid being obscure, each chapter will be as context-independent and concise as possible, so please enjoy with confidence. Consequently, this series will sacrifice some precision and is not systematic; it merely aims to spark a little interest. Note: Examples are all generated by KimiChat.

Author: 木鸟杂记 https://www.qtmuniao.com/2024/06/29/interesting-linear-algebra-1/ please indicate the source when reposting

Right-multiplying a Column Vector

la-Ax-b.pngla-Ax-b.png

For a square matrix A, right-multiplying it by a column vector x can be understood as: using the values in x as weights to perform a linear combination of the column vectors in A, resulting in a new column vector b.

Using this understanding to break down the figure above:

la-b-A.pngla-b-A.png

Note: This requires certain properties, such as A being an invertible matrix or a non-singular matrix, but we won’t delve into these terms here. Those interested can watch the video.

Left-multiplying a Row Vector

la-matrix-vector.pngla-matrix-vector.png

For a square matrix A, left-multiplying it by a row vector x can be understood as: using the values in x as weights to perform a linear combination of the row vectors in A, resulting in a new row vector b.

Breaking down the process:

la-b-linear.pngla-b-linear.png

Extension

With the above intuition, we can extend it to break down matrix multiplication.

For example, using right-multiplication by row vectors to break it down.

A * X = B

It can be broken down as:

la-B-as-A.pngla-B-as-A.png

That is, using the three columns in X to perform linear combinations on A respectively, obtaining the three columns in the result B.

Similarly, you can also use left-multiplication by row vectors to break down the above multiplication; you can try it yourself.

Summary

Of course, sometimes this way of thinking might make simple operations more complicated. But as you learn more, you’ll discover that for the same formula in linear algebra, there are multiple “physical interpretations,” and each interpretation has its specific applicable scenarios. Accumulating more tools in your toolbox will make us more adept at matrix operations, this kind of high-dimensional thinking.


我是青藤木鸟,一个喜欢摄影、专注大规模数据系统的程序员,欢迎关注我的公众号:“木鸟杂记”,有更多的分布式系统、存储和数据库相关的文章,欢迎关注。 关注公众号后,回复“资料”可以获取我总结一份分布式数据库学习资料。 回复“优惠券”可以获取我的大规模数据系统付费专栏《系统日知录》的八折优惠券。

我们还有相关的分布式系统和数据库的群,可以添加我的微信号:qtmuniao,我拉你入群。加我时记得备注:“分布式系统群”。 另外,如果你不想加群,还有一个分布式系统和数据库的论坛(点这里),欢迎来玩耍。

wx-distributed-system-s.jpg