Representing information / 1 of 7

Linear algebra for learning systems

8 minOpening your notebook…

What you’ll learn

  • Explain the main idea of “Linear algebra for learning systems” in your own words.
  • Trace a concrete example and identify the assumptions behind it.
  • Apply the principle in a practice problem and recognize a common failure.

The idea, intuitively

Linear algebra lets us describe many measurements and transformations together. A feature vector is an ordered list, and a matrix can transform one vector into another. The ordering and units of features are part of the model contract.

Use small numbers first and work one operation at a time. Track the shape and units of every quantity before doing algebra. The equations here describe idealized objects; implementing them on a computer introduces finite precision and resource constraints. You can understand the mechanism before learning every proof.

Under the hood

For a matrix W with m rows and n columns, multiplying an n-dimensional input produces an m-dimensional output. Each output is a weighted sum of input coordinates.

y=Wx+by=Wx+b
W contains the weights, x is the input, b adds an offset to each output, and y is the result. A row of W and the corresponding bias produce one coordinate of y.
A useful caution

Matrix multiplication generally depends on order: AB need not equal BA.

A worked example

Take the ordered input x = [3, 4]. Use the three rows [1, 0], [0, 1], and [2, −1] of a 3 × 2 matrix W. Each row acts on both readings. With zero bias, the first two rows copy 3 and 4. The third gives 2 × 3 − 1 × 4 = 2.

The result is [3, 4, 2]. The two inner dimensions match, and the three rows determine the output length.

How to use this way of thinking

Check a symbolic result with a numeric example, then consider an edge case such as zero, a very large value, or an incompatible shape. Explain what each symbol means rather than memorizing the equation. If a result surprises you, inspect the assumptions and the units first.

Try it yourself

Compute [2, −1] · [3, 4].

Key takeaways

  • 4 coordinates
  • Matrix multiplication generally depends on order: AB need not equal BA.
  • Check the assumptions with a small example before applying this idea to a larger system.

Check your understanding

0/2 checked

Use feedback to learn. Quiz scores and lesson completion are tracked separately.

1What is the output size of a 4 × 3 matrix times a 3-vector?
2True or false: Matrix multiplication generally depends on the order of the matrices.
Go to lesson completion

Further reading

Original papers and reference material for this school. External resources may be in English and require internet access.

Mathematics for Machine Learning (open textbook) (opens a new tab)

Finish this lesson

Mark this lesson complete when you’re ready to continue.

Start with a question

Introduction to AIAI FoundationsA brief history of AIAI FoundationsTypes of AIAI FoundationsAI, ML, and deep learningAI FoundationsUnderstanding generative AIAI FoundationsEthics, limitations, and responsibilityAI FoundationsLinear algebra for learning systemsMathematics for AIVectors, matrices, and similarityMathematics for AICalculus: measuring changeMathematics for AIDerivatives and gradientsMathematics for AIProbability and statisticsMathematics for AIOptimization and objectivesMathematics for AI
K to open · Escape to close