Tensor by Tensor

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

  1. A vector keeps numbers in order. Here, x₁ = 2 and x₂ = 3.
  2. The first matrix row is [4,1]. Its weighted sum is 4×2 + 1×3 = 11.
  3. The second row is [1,2]. Its weighted sum is 1×2 + 2×3 = 8.
  4. The matrix has shape (2,2). The input has length 2. The output has length 2.
  5. Common mistake: changing [2,3] to [3,2] changes the meaning and both weighted sums.
Open the detailed notes ↗