Math for ML - Beginner - 10 min

Learn Matrices & Transformations

A free visual AI and machine learning lesson with an interactive 3D visualization, plain-English theory, and quiz.

Last updated: 2026-05-13.

A matrix is a grid of numbers. But more importantly, a matrix is a transformation — a recipe for reshaping space. When you multiply a matrix by a vector, you move that vector to a new position. That's the core of how neural networks process data.

What transformations can a matrix do?

A 2D matrix can rotate a vector (spin it around the origin), scale it (make it bigger or smaller), reflect it (flip it like a mirror), or shear it (slant it sideways). In 3D, it can do all of these simultaneously.

Why matrices matter in ML

A neural network layer with 512 neurons and 256 inputs is a 512×256 matrix — 131,072 weights. The forward pass is just: output = matrix × input. Training adjusts every number in that matrix until it transforms data perfectly for the task.

Practice questions

  1. What does multiplying a matrix by a vector do?
  2. A neural network layer has 128 inputs and 64 neurons. What shape is its weight matrix?
  3. Which of these is NOT something a matrix transformation can do?
  4. What does the identity matrix do to a vector?

Related AI learning resources

Premium lesson notes and simulations | AI project templates | More Math for ML lessons