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

The idea

A vector is an ordered list. A matrix makes weighted sums from that list.

A worked example

Use x = [2,3] and W = [[4,1],[1,2]]. Then Wx = [11,8].

The input

A two-number vector and a matrix with two columns.

The result

One weighted sum per matrix row. Here, the output is [11,8].

Why you use it

Neural layers use matrices to mix many input features at once.

A limit to remember

A matrix does not know what its rows mean. Your program defines that meaning.

Check your understanding

  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 ↗