向量:箭頭、數列與嵌入
僅在記錄預測與觀察證據後才可使用協助。
前置要求
完成第 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 的平行四邊形幾何,並能用一句話說明嵌入表的一行 E[token_id] 為什麼是向量。
權威來源資源與權利證明
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.