The Equation That Breaks Beginners
You see this on a slide: KING - QUEEN = HUSBAND - WIFE. Your brain says: 5 - 3 = 2. Easy.
It is not 5 - 3 = 2. KING isn't a number. KING is a 4,096-dimensional vector. Subtraction here means element-wise vector subtraction. The equation is saying: the displacement from QUEEN to KING in meaning-space is roughly the same direction and length as the displacement from WIFE to HUSBAND. That's why word embeddings can do analogy tasks.
The first time you see this, every instinct from grade-school math misfires. That's the scalar trap.
Three Operators You Thought You Knew
| Operator | On scalars | On NumPy/PyTorch arrays |
|---|---|---|
+ - | arithmetic | element-wise (broadcasting may apply) |
* | multiplication | element-wise, NOT matrix product |
@ or np.dot | (no equivalent) | matrix multiplication / dot product |
Mixing these up is the #1 source of "why does my model output nonsense" bugs in week one.
And the Equal Sign Itself
Grade school taught you "= means the answer is on this side." That's a lie of convenience. The equal sign means equilibrium. Both sides represent the same thing. When you "move b to the other side" in a + b = c, you're not moving anything — you're applying subtract b to both sides simultaneously to keep the balance. Same in matrix algebra: AX = B doesn't become X = B/A; it becomes X = A^{-1} B (left-multiply both sides by the inverse).
Don't Confuse = and == in Code Either
While we're here: in Python, = assigns. == tests equality. Mixing them is a Python rite of passage. if x = 5 is a syntax error. if x == 5 is a check. The world doesn't end if you confuse them, but your debugger session might.
output = input @ W + b *는 같은 자리끼리 곱하니 B의 0이 A의 정보를 죽이고, @는 A의 행과 B의 열을 내적해서 합치니 B에 0이 있어도 다른 항이 살아남아 A 전체가 2배로 보존된다. 내적: 물건 개수: [사과 3개, 빵 2개] 물건 가격: [사과 1000원, 빵 2000원] "곱해서 다 더하는 것." 장 보면서 매일 하는 계산