Vectors

16 min read

A vector is a list of numbers that describes something. AI turns words, photos and songs into vectors, so that a computer can compare them. In this lesson you add vectors, measure them, and find which two are most alike.

New words

Vector
A list of numbers that describes one thing, like a point or an arrow.
Dimension
How many numbers a vector has. [3, 4] has 2 dimensions.
Length
How long the arrow is. It is also called the norm.
Dot product
Multiply the matching numbers of two vectors, then add them all.
Cosine similarity
A score from -1 to 1 for how much two vectors point the same way.
Embedding
A vector of numbers that stands for the meaning of a word or text.

What you will learn

  1. Where do vectors show up in AI?
  2. What is a vector?
  3. How is a 2D vector an arrow?
  4. How do you add and scale vectors?
  5. How do you find the length of a vector?
  6. What is the dot product?
  7. What is cosine similarity?
  8. Why do AI engineers care? Embeddings and search
  9. Try it: move the arrows
  10. What mistakes do people make?
  11. Explain it to a friend
  12. Key takeaways

10 quiz questions at the end.

Start this lesson

The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.

All lessons · Back to the roadmap