向量:箭头、数列与嵌入
仅在记录预测与观察证据后才可使用协助。
前置要求
完成第 21 天复习;如有缺失概念,使用列出的恢复链接。
学习目标
把向量同时表示为平面上的箭头和有序数列;逐分量计算加法、数乘与线性组合,并把词元嵌入与 d 维向量联系起来。
操作指引
向量 v = (v1, v2, ..., vd) 既是 d 维空间中的箭头,也是一行数字。加法与数乘按分量进行。线性组合 a*v + b*w 把两个向量混合;张成空间(span)是所有可由这种混合到达的点。在语言模型中,每个词元 id 从 shape 为 V x d 的嵌入表 E 中取出一行,该行就是 R^d 中的一个向量。
自主演练与记录
设 v = (1, 2),w = (3, -1)。计算前先预测:(a) v + w;(b) 2*v;(c) 线性组合 2*v - w。然后用手算和代码验证。
逐分量计算:(v+w)_i = v_i + w_i,(c*v)_i = c*v_i。在方格纸上画出箭头,观察 v + w 的平行四边形。
(a) v + w = (1+3, 2-1) = (4, 1)。(b) 2*v = (2, 4)。(c) 2*v - w = (2-3, 4+1) = (-1, 5)。平行四边形法则表明 v + w 落在由 v 与 w 构成的平行四边形对角顶点。嵌入表的行 E[token_id] 正是这样一个含 d 个分量的向量。
你的预测表与每个计算分量一致,能描述 v + w 的平行四边形几何,并能用一句话说明嵌入表的行为什么是向量。
权威源资源与权利证明
Essence of Linear Algebra
对应章节 / 时间戳: Chapters 1-2: Vectors and linear combinations, span and basis vectors
验证版本与日期: 2016-2023 (Verified: 2026-10-30)
Unequaled geometric and visual intuition for vectors, linear transformations, matrix multiplication, and inverses before tensor operations.
High-school coordinate geometry
Geometric explanations, worked formulas, and coordinate exercises are fully provided as original lesson text.
对比候选资源与选型分析 (2)
Established textbook/lecture approach, strong mathematical rigor alongside 3Blue1Brown visual intuition.
Theoretical determinant-free proof structure is mathematically elegant but less aligned with computational tensor engineering.
18.06 Linear Algebra (Prof. Gilbert Strang)
对应章节 / 时间戳: Lecture 1: The geometry of linear equations (row and column pictures)
验证版本与日期: Spring 2010 (Verified: 2026-10-30)
Established row-picture and column-picture treatment of linear systems, matrix products, and invertibility; rigorous complement to the 3Blue1Brown visual series.
High-school algebra and coordinate geometry
All row/column-picture derivations and worked examples are written as original lesson text and run offline.
对比候选资源与选型分析 (3)
Selected as co-primary: geometric visualizations paired with Strang's algebraic rigor.
Determinant-free theoretical treatment is elegant but further from the computational shape accounting required here.
Interactive figures are attractive, but the absence of a declared open license makes rights disposition unclear; kept out of the resource set.