分享

线性代数笔记06 | 通过2D到1D的线性转化和投影可视化理解向量间的点积

 天选小丑 2023-07-08 发布于广西

Linear Algebra Note 06 - Dot Products and Duality

此篇笔记是「线性代数笔记」系列的第6篇,记录了「3Blue1Brown」「Essence of linear algebra」系列课程的第9章内容,讨论了线性代数中「点积的概念」,强调了它们的「几何解释」以及「与线性变换的联系」,以及「点积与投影之间的关系」;最后介绍了「对偶性」的概念,强调了「向量和线性变换之间的对应关系」

1. Intro to Dot Products

Numerical Computation

图片

Numerically, the 「dot product of two vectors with the same dimensions」 involves 「pairing up coordinates」, 「multiplying them」, and 「adding the results」.
在数值上,「两个维数相同的向量的点积」涉及「配对坐标」, 「相乘并将其结果相加」

Geometric Interpretation (as Projections)

图片

Geometrically, it represents 「the projection of one vector onto another」.
在几何上,它表示「一个向量在另一个向量上的投影」

  • imagine 「projecting」 「onto the line」 that 「passes through the origin and the tip of  
    想象将向量 「投影」「过原点和向量 终点」「直线上」
  • 「Multiplying」 the 「length of this projection of by the 「length of , then get the 「dot product
    「投影的长度」「向量 的长度相乘」, 就得到了它们的「点积」

The Sign of the Dot Product

图片
  • The 「dot product is positive」 when 「two vectors」 generally point in the 「same direction」,
    「两个向量」大致指向「相同方向」时,「点积是正的」
  • 「zero」 when they are 「perpendicular」,
    当它们「垂直时」「点积为零」
  • 「negative」 when they 「point generally in opposite directions」
    当它们大致「指向相反方向时」「点积为负」

The Order of the Dot Product

图片

「The order of dot product calculations does NOT matter」
「点积的计算顺序无关紧要:」

2. Think Dot Products as Linear Transformations

Visual Linearity Properties

图片

If we take 「a line of evenly spaced dots」 and 「apply a linear transformation」
如果我们有一系列「等距分布于一条直线上的点」,然后进行一个「线性变换」

  • this 「linear transformation will keep those dots evenly spaced」, once they land in the 「output space」, which is 「the number line」
    「线性变换会保持这些点等距分布」「输出空间中」,也就是「数轴」
  • Otherwise, if there's 「some line of dots that gets unevenly spaced」 then the 「transformation is NOT linear」
    否则,如果「这些点没有等距分布」, 那么「这个变换就不是线性的」

Transformation from 2D to 1D

图片

In this case, 「each of basis vectors」 and just 「lands on a number」.
这一次,这些「基向量」 「落在一个数上」

  • so when we record 「where they land after the transformation as the columns of a matrix」, 「each of those columns」 just has a 「single number」
    所以当我们将它们「变换后的位置记录为矩阵的列」时,「矩阵的每列」只是「一个单独的数」
  • so 「the transformation matrix from 2D to 1D is a 1 x 2 matrix」
    所以这个「从2D到1D的变换矩阵是一个 1×2 矩阵」

Example

图片

If a linear transformation that takes to and to , to follow where a vector ends up

  • think of breaking up this vector as   +  .
  • A 「consequence of linearity」, is that 「after the transformation」 the vector will be:

3. Projection Matrix

图片

「Place a number line diagonally in space」 somehow with the number 0 sitting at the origin, think of the 「two-dimensional vector」 , whose 「tips sit where the number 1 on the number line is」
「将一个数轴斜向放置在空间中」,保持 0 在原点,现在考虑这样一个「二维向量」 , 它的「终点落在这条数轴的 1 上」

  • If we 「project 2D vectors」 straight 「onto this diagonal number line」, in effect, we've just 「defined a function that takes 2D vectors to numbers」
    如果「将二维向量」直接「投影到这条数轴上」, 实际上, 我们就这样「定义了一个从二维向量到数的函数」
  • this 「function is actually linear」 since it 「passes our visual test」 that 「any line of evenly spaced dots remains evenly spaced」 once 「it lands on the number line」.「这个函数是线性的」,因为它顺利「通过了线性检验」,即「直线上等距分布的点」「投影到数轴上」「仍然等距分布」
图片

With this 「projection」, we just 「defined a linear transformation from 2D vectors to numbers」, so we're going to be able to 「find some kind of 1 x 2 matrix that describes that transformation」
根据这个「投影」, 我们定义了一个「从二维向量到数的线性变换」, 所以我们就能够「找到描述这个变换的 1×2 矩阵」

  • think about 「where and each land」, since 「those landing spots」 are going to be 「the columns of the Projection Matrix」
    考虑「变换后 的位置」,因为它们就是「投影矩阵的列」
图片

we can 「reason through it」 with 「a line of symmetry」
我们可以通过「一条对称线」进行「推理」

  • by symmetry, 「the number where lands when it’s projected onto that diagonal number line」 is going to be 「the x-coordinate of
    因此根据对称性,「将 向斜着的数轴上投影所得到的数」就是 的横坐标」
  • the 「y-coordinate of gives us 「the number where lands when it’s projected onto the number line」.
    的纵坐标」给出了 向斜着的数轴上投影所得到的数」

So 「the entries of the 1 x 2 matrix」 describing the 「projection transformation」 are going to be the 「coordinates of .
所以「描述投影变换」「1×2 矩阵的两列」「分别是 的两个坐标」

Interpret Dot Products as projecting and scaling

图片

「Computing this Projection Transformation」 for 「arbitrary vectors」 in space, which requires 「multiplying the Projection Matrix by those vectors」
空间中「任意向量」经过「投影变换的结果」也就是「投影矩阵与这个向量相乘」

  • is computationally 「identical to taking a dot product with
    这和「这个向量与 的点积在计算上完全相同」
  • This is why 「taking the dot product with , can be interpreted as 「projecting a vector  onto the span of and then 「scaling up the length of that projection」 by 「the length of
    这就是为什么「与 的点积」可以解读为「将向量 投影到 所在的直线上」然后「将投影的值」 的长度相乘」

4. Duality

图片

Loosely speaking, 「Duality」 refers to situations where you have a natural but surprising correspondence between 「two types of mathematical thing」, for the linear algebra case 粗略地说,对偶性指的是「两种数学事物」之间「自然而又出乎意料的对应关系」, 对于线性代数来说

  • the 「dual of a vector」 is the 「linear transformation that it encodes」
    一个「向量的对偶」「由它定义的线性变换」
  • the 「dual of a linear transformation from space to one dimension」, is 「a certain vector in that space」
    一个「多维空间到一维空间的线性变换的对偶」「多维空间中的某个特定向量」

5. Summary

💡 Dot products are traditionally introduced early in linear algebra courses and involve multiplying coordinates and adding the results.
点积通常在线性代数课程的早期引入,涉及坐标相乘然后将结果相加。

💡 The dot product can be geometrically interpreted as the length of the projection of one vector onto another.
几何上,点积可以解释为一个向量在另一个向量上的投影的长度。

💡 The dot product is positive when vectors point in the same direction, zero when they are perpendicular, and negative when they point in opposite directions.
当向量指向相同方向时,点积是正的;当它们垂直时为零;当它们指向相反方向时为负。

💡 Order doesn't matter in dot product calculations, and the same result can be obtained by projecting the second vector onto the first.
在点积计算中,顺序不重要,通过将第二个向量投影到第一个向量上可以得到相同的结果。

💡 Dot products have a connection to linear transformations, with a numerical computation similar to matrix-vector multiplication.
点积与线性变换有关,其数值计算类似于矩阵-向量乘法。

💡 Linear transformations from higher dimensions to one dimension can be described by 1x2 matrices, and the computation is equivalent to taking a dot product.
从高维到一维的线性变换可以用1x2矩阵描述,计算等价于进行点积。

💡 Dot products demonstrate duality, which reveals a correspondence between vectors and linear transformations.
点积展示了对偶性,揭示了向量和线性变换之间的对应关系。

💡 The dot product is a useful tool for understanding projections and vector relationships in geometry.
点积是在几何中理解投影和向量关系的有用工具。

References:

[1] https://www./lessons/dot-products
[2] https://github.com/3b1b/videos/blob/master/_2016/eola/chapter7.py

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多