MODULE 01 · LESSON 03
Vectors
A vector is an ordered list. A matrix makes weighted sums from that list.
PLAIN-LANGUAGE INTRODUCTION
What is this?
A vector is an ordered list. A matrix makes weighted sums from that list.
One simple example
Use x = [2,3] and W = [[4,1],[1,2]]. Then Wx = [11,8].
What goes in?
A two-number vector and a matrix with two columns.
What comes out?
One weighted sum per matrix row. Here, the output is [11,8].
Why does it matter?
Neural layers use matrices to mix many input features at once.
What is it not?
A matrix does not know what its rows mean. Your program defines that meaning.
WORK THROUGH THE IDEA
See the idea in more detail
- A vector keeps numbers in order. Here,
x₁ = 2andx₂ = 3. - The first matrix row is
[4,1]. Its weighted sum is4×2 + 1×3 = 11. - The second row is
[1,2]. Its weighted sum is1×2 + 2×3 = 8. - The matrix has shape
(2,2). The input has length2. The output has length2. - Common mistake: changing
[2,3]to[3,2]changes the meaning and both weighted sums.