Settings

Theme
Lite Mode (saves mobile data)

In Lite Mode, animations and videos don't play until you tap them, and their size is shown first. Interactive widgets still work.

Text size

Back up or move your progress →

Understand machine learning by seeing it move.

Machine learning and deep learning, explained visually, from basic math to LLMs. Drag vectors, roll a ball down a loss curve, step through backpropagation one number at a time.

Try a lesson

Good places to start. Each one stands on its own and links back to what it builds on.

P0.2How a machine "learns"The learning loop in five words - data, model, prediction, loss, update. Watch a line fit itself to points one step at a time, and see why this same loop trains everything from a straight line to a chatbot.25 min · 🎛️ A line fitting itself to points, one loop step per clickP1.B3Dot product and cosine similarityOne number that says how much two vectors point the same way. It powers search, recommendations and the attention inside every LLM.15 min · 🎛️ Two arrows, live dot product and angle, projection shadowP1.C3The chain ruleA function inside a function changes through two steps, and the two rates multiply. See why with gears and nudges, use the rule on e^(2x), ln(1+x^2), the sigmoid, tanh and two losses, then follow a long chain backward, which is exactly what backpropagation does.45 min · 🎞️ Gears of different sizes turning togetherP1.F3Gradient descentWalk downhill one step at a time. The algorithm that trains nearly every neural network, and why the step size matters so much.25 min · 🎛️ Ball on surface with learning-rate slider (diverges when too big)P4.8Backpropagation: step by step with numbersFollow every number through a forward pass, a backward pass and one weight update, and see the local rules that make backprop work, then learn how to check it.25 min · 🎛️ Step-through tiny network with every number visibleP1.B13Singular Value DecompositionSee every matrix as rotate, stretch, rotate. Learn singular values and the SVD, keep only the biggest layers to compress a picture or a weight matrix, build the pseudo-inverse, and read the condition number and numerical rank off the singular values.50 min · 🎛️ Image compression with a "rank k" slider (→ LoRA preview)
Show all 55 ready lessons
P0.1What are AI, ML and Deep Learning?Three terms that get mixed up, as three nested circles. See the difference between writing rules and learning from data, learn the key vocabulary, and tour more than 70 years of AI history, including its two "winters".20 min · 🎞️ Animated timeline 1950→today; Venn diagram that zooms inP0.3Kinds of learningSupervised, unsupervised, self-supervised and reinforcement learning, side by side. Learn what data each one needs, what it learns from, and how real systems such as chatbots combine them. Then test yourself with a game.25 min · 🖼️ Four-panel illustrated comparisonP0.4Your toolkitWhere you will run code in this course, and how. Run your first Python and NumPy cells right here in the browser, learn what a notebook is, how to read an error message, and when to use Google Colab or your own computer. No install and no GPU needed to start.30 min · 💻 First in-browser cell: `print` and a NumPy arrayP0.5How to use this siteA guided tour of a lesson page (tabs, widgets, quizzes), how your progress is saved on your own device, how to save data with Lite Mode, how to pick a learning path, study habits that research supports, and how to report a mistake.20 min · 🖼️ Annotated screenshot tourP1.A1Functions and graphsA function turns an input into exactly one output. Learn to read formulas, tables and graphs, and to recognise the lines, parabolas and exponentials that machine learning is built from.30 min · 🎛️ Function plotter with sliders for coefficientsP1.A2Exponents and logarithmsPowers multiply, logarithms undo them. Learn the exponent and log rules, the number e, log scales, and why machine learning turns products into sums with logs.35 min · 🎛️ Linear vs. log-scale axis toggleP1.A3Summation, products and indicesRead and write Σ (sum) and Π (product) notation, unroll them into plain additions, use the rules for sums, handle double sums, and avoid the classic off-by-one bug between math and Python.35 min · 🎞️ Σ unrolling into a row of additionsP1.A4Sets, notation and reading mathLearn the small set of symbols that papers and textbooks use (sets, ∈, ℝⁿ, ∀, argmax, hats, ∝, ∼) and a step-by-step method for reading any formula, with an interactive, printable cheat sheet.40 min · 🖼️ Printable notation cheat sheetP1.A5The sigmoid, tanh and other squashing functionsBuild the sigmoid and tanh from e^(−z), see why they squash any number into a fixed range, watch them saturate (go flat) for large inputs, and meet the step, softsign and hard sigmoid. Includes the logit, stretching and shifting, and safe code.40 min · 🎛️ Overlaid curves with draggable inputP1.B1Scalars, vectors and spacesA vector is one object with three faces (an arrow, a list of numbers and a point). Learn to move between them, and see why images, words, houses and model weights are all vectors.25 min · 🎛️ Drag a 2D/3D arrow and watch its coordinates updateP1.B2Vector operationsAdd vectors, stretch them, subtract them and combine them. The few moves behind every gradient step, every average of embeddings and every residual connection.25 min · 🎛️ Tip-to-tail addition, scaled with slidersP1.B4Norms and distancesHow long is a vector, and how far apart are two of them? Three ways to measure (L1, L2, L∞), the shapes of their unit balls, and why the choice changes which point counts as nearest.30 min · 🎞️ Unit "circles" morphing from L1 to L∞P1.B5Matrices as data and as transformationsA matrix is a rectangle of numbers with two jobs in machine learning. It stores data (one row per example) and it acts on vectors, warping space. Learn to read both.30 min · 🎛️ 2D grid that warps as you edit the 4 matrix entriesP1.B6Matrix multiplicationMultiply two matrices as row times column, check shapes before you start, and see the product as "first one map, then the other". Learn why the order matters, what a product costs, and where it appears in neural networks.40 min · 🎞️ Row sliding across column; 🎛️ shape checkerP1.B7Span, independence, basis and rankWhich vectors can you make from a few vectors, and which of them are redundant? Learn span, independence, basis, subspaces and rank, see why a matrix can squash the plane, and where redundancy shows up in machine learning.45 min · 🎛️ Two vectors whose span collapses to a line when they alignP1.B8The determinantHow much does a matrix stretch area? Learn the determinant as a signed area and volume, what its sign and zero mean, the rules it obeys, how computers calculate it, and where it appears in machine learning.40 min · 🎛️ Unit square's area changing as the grid warpsP1.B9Inverse and linear systemsUndo a matrix with its inverse, learn when no inverse exists, and solve Ax = b by elimination. See one, no and infinitely many solutions as lines and as columns, and learn why code solves instead of inverting and what a nearly singular system does to errors.45 min · 🎞️ Transform then inverse-transform the gridP1.B10Transpose, symmetric and orthogonal matricesFlip a matrix across its diagonal, see what the transpose really does to a dot product, meet symmetric matrices, and learn why rotations and reflections (orthogonal matrices) keep every length and angle and are undone by their transpose.40 min · 🎛️ Rotation matrix with angle sliderP1.B11Projections and least squaresDrop a point straight onto a line or a plane, see why the error meets the plane at a right angle, and use that picture to derive the normal equations, fit a line to data, and understand what NumPy's least-squares routine does.45 min · 🎞️ Point dropping a perpendicular onto a planeP1.B12Eigenvalues and eigenvectorsFind the directions a matrix only stretches, flips or squashes. Learn eigenvalues and eigenvectors as the way to see what a matrix really does, how to find them, why repeated multiplication is ruled by the biggest one, and where they appear in machine learning.45 min · 🎛️ Grid warp with eigen-directions highlighted in colorP1.B14Tensors, shapes and broadcastingCount the axes of an array, index and reshape it without scrambling it, add up along the right axis, and learn the one rule NumPy uses to combine arrays of different shapes, including the silent shape bug that turns a loss into the wrong number.40 min · 🎞️ Broadcasting "stretching" a smaller array; 💻 shape puzzlesP1.B15Linear algebra in neural nets: a mapSee where the tools of the linear algebra module live inside a neural network, from a dense layer to a tiny attention example worked by hand, and which later lesson teaches each piece.25 min · 🖼️ Concept map linking forward to later lessonsP1.C1Rates of change and the derivativeStart with average speed, shrink the time interval until you get the speed at one instant, and meet the derivative as the slope of a curve. Zoom into curves until they look straight, estimate slopes with finite differences, and see where a derivative does not exist.40 min · 🎛️ Zoom into a curve until it looks straightP1.C2Derivative rulesReplace the limit with shortcuts. Learn the constant, sum, power, exponential, logarithm, product and quotient rules, see why each one is true, check every rule against a finite difference, and use them to get the slopes of the sigmoid, tanh and a squared-error loss.45 min · 🖼️ Rule cards; 💻 check with finite differencesP1.C4Partial derivativesA loss depends on many numbers at once. Nudge one input while the others stay put, and the ordinary derivative of P1.C1 becomes a partial derivative. Slice a 3-D surface, compute partials with the rules of P1.C2, find both slopes of the P0.2 loss, and see why one partial per weight is what training needs.40 min · 🎛️ 3D surface sliced along x or yP1.C5The gradientPut the partial derivatives of P1.C4 into one vector, the gradient. See it on a contour map, check the first-order approximation with numbers, and learn why the gradient points uphill, is perpendicular to the contour lines, and has a length equal to the steepest slope. Then step against it, which is gradient descent.40 min · 🎛️ Contour map with gradient arrow following the cursorP1.C6Directional derivativesCut a surface along a straight line and read the slope of the cut. See the directional derivative as a limit, prove that it equals the gradient dotted with the direction, handle vectors that are not unit vectors, and learn where the formula fails.30 min · 🎛️ Rotating direction arrow with live slope readoutP1.C7Vector functions and the JacobianA layer of a neural network turns many numbers into many numbers. Collect all its slopes into one matrix, the Jacobian, see that near a point the curved map acts like that matrix (a tiny square becomes a parallelogram), and use it for the chain rule, area scaling, and the products that backpropagation computes.40 min · 🎞️ Tiny square warped into a parallelogramP1.C8The Hessian, curvature and Taylor approximationLearn how the ground bends. Build Taylor polynomials one term at a time, see where they stop working, then collect all second derivatives in the Hessian matrix. Its eigenvalues tell a bowl from a hill or a saddle, set the largest safe learning rate, and give Newton's step.45 min · 🎛️ Taylor polynomial terms added one at a timeP1.C9Integrals as accumulationAdd up a rate to get a total, see that this is the area under a curve, build it from thinner and thinner rectangles (Riemann sums), and meet the integral, the fundamental theorem of calculus, antiderivatives, and the way probability densities use all of it.45 min · 🎛️ Rectangles getting thinnerP1.C10Computational graphs and automatic differentiationDraw a calculation as a graph of simple steps, run it forward for the values, then run it backward once to get the slope with respect to every input. Compare reverse mode with forward mode, finite differences and symbolic formulas, and write a tiny autodiff engine in Python.45 min · 🎛️ Step-through graph with values going forward and gradients flowing backP1.C11Matrix calculus for MLThe short list of rules for gradients of vectors and matrices, with a shape check for each. Derive the gradients of a dense layer, a batch, xᵀAx, a squared norm, least squares and softmax with cross-entropy, check them by nudging, and learn to spot the common shape bugs.45 min · 🖼️ Cheat sheet; 💻 verify with autogradP1.D1Probability basicsBuild probability from scratch. Outcomes, sample spaces and events, the three rules every probability must obey, counting equally likely outcomes, and the difference between a probability and the frequency you see in a short run. A coin and dice simulator lets you watch frequencies settle.40 min · 🎛️ Dice/coin simulator with running frequenciesP1.D2Random variablesTurn the outcomes of a random experiment into numbers. Meet discrete and continuous random variables, the PMF, the density (PDF) and the CDF, see them linked by one draggable point, and read probabilities, intervals and quantiles from them.40 min · 🎛️ PDF and CDF linked: drag a point on one, see the otherP1.D3Common distributionsMeet the six distributions behind most of machine learning, Bernoulli, binomial, categorical, uniform, Gaussian and Poisson. For each one you see what it models, its formula, its mean and variance, and where it appears in a loss function. A gallery with parameter sliders lets you change each one and read off probabilities.40 min · 🎛️ Distribution gallery with parameter slidersP1.D4Expectation and varianceSummarise a whole distribution with two numbers. The expected value is its balance point and its long-run average; the variance and standard deviation say how far values stray from it. Drag a histogram on a fulcrum, learn linearity of expectation, the rules for variance, why an average of n draws has spread σ/√n, and why the mean is the best constant guess under squared error.45 min · 🎞️ Histogram balancing on a fulcrumP1.D5Joint, marginal and conditional probabilityDescribe two random quantities at once. Read a joint probability table, add up its rows and columns to get marginals, slice and renormalize it to get conditional probabilities, and test whether the two quantities are independent. Click a heatmap to condition on a row or a column, then meet the product rule, the chain rule, the law of total probability, conditional independence and the i.i.d. assumption behind most of machine learning.45 min · 🎛️ 2D heatmap with marginals on the edges; click to conditionP1.D6Bayes' theoremUpdate a probability when evidence arrives. Count 1000 people to see why a positive result from a good medical test is often a false alarm, derive Bayes' theorem from the product rule, learn prior, likelihood and posterior, the odds form, updating with several results and several hypotheses, and what it means for classifiers, precision and spam filters.45 min · 🎛️ Medical test "1000 people" frequency gridP1.D7Covariance and the multivariate GaussianMeasure how two quantities move together with covariance and correlation, collect all the pairs into a covariance matrix, and see the multivariate Gaussian as a cloud whose outline is an ellipse. Drag the ellipse and watch the matrix, its eigenvalues and eigenvectors, the conditional mean and the sample covariance update, then meet marginals, conditionals, sampling with a Cholesky factor and Mahalanobis distance.45 min · 🎛️ Drag ellipse; covariance matrix updatesP1.D8Law of large numbers and the Central Limit TheoremWhy averages settle and what shape their wobble has. Prove from Chebyshev's inequality that the average of many independent draws gets close to the mean, watch a Galton board turn coin steps into a bell curve, and see in a sample-mean histogram that the average of n draws from almost any population is close to Gaussian with spread σ/√n, and where that fails.45 min · 🎞️ Galton board; 🎛️ sample-mean histogramP1.D9Sampling and Monte CarloEstimate a probability, an average or an integral by drawing random samples. Throw darts at a square to estimate π, see why the error shrinks like 1/√n in any dimension, and learn how computers turn uniform random numbers into draws from other distributions, by table lookup, the inverse CDF, Box–Muller and rejection.40 min · 🎛️ Darts thrown at a squareP1.D10Maximum Likelihood EstimationHow to fit a model's parameters to data. Write the probability of the data as a function of the parameters, take its log, and find the maximum. Slide a Gaussian over data and watch the log-likelihood peak at the sample mean, derive the coin and Gaussian estimates, and see why the same recipe gives mean squared error, binary cross-entropy and cross-entropy.50 min · 🎛️ Slide a Gaussian over data, watch likelihood peakP1.D11MAP estimation and priorsKeep the prior that maximum likelihood throws away. See how prior × likelihood gives a posterior for a coin, how a Beta prior acts like imagined flips, why the prior fades as data arrive, and why a Gaussian prior on weights is L2 regularization (weight decay) and a Laplace prior is L1.45 min · 🎞️ Prior × likelihood → posterior animationP1.D12Descriptive statistics and visualizationSummarize a data set with a few numbers and a few pictures. Compare mean, median and mode, see which spread measures survive an outlier, read percentiles and box plots, standardize features, and learn why a summary can hide the shape of the data. Add outliers to a data set and watch the mean move while the median stays.40 min · 🎛️ Add outliers and watch mean vs. medianP1.D13Statistical thinking for MLA number measured on a sample is an estimate, not the truth. Learn standard errors and confidence intervals, hypothesis tests and p-values, power, multiple comparisons, and why correlation is not causation. Run thousands of simulated experiments and see how often two identical models look different.45 min · 🎛️ Run "experiments" and see how often you're fooledP1.E1Information and surpriseHow to measure how surprising an event is. Rarer events carry more news, and the logarithm is the function that makes the surprise of independent events add up. Slide a probability along the curve, switch between bits and nats, and see why the loss of a classifier or a language model is a surprise.30 min · 🎛️ Probability slider vs. surprise curveP1.E2EntropyEntropy is the average surprise of a source, one number for how hard its next outcome is to predict. Reshape a distribution and watch the entropy move, see why the uniform distribution is the most uncertain, and learn why entropy is also the limit for lossless compression and the quantity behind decision-tree splits, model confidence and temperature.35 min · 🎛️ Bar chart distribution you can reshape; entropy meterP1.E3Cross-entropyCross-entropy is the average surprise of outcomes from the true distribution p when they are measured with a model q. See why it is the standard loss for classification and language models, how it splits into the entropy plus an extra cost for a wrong model, and how to reshape a prediction and watch the loss change live.35 min · 🎛️ True vs. predicted distribution, loss updating liveP1.F1What is optimization?Training a model means choosing parameters that make one number, the loss, as small as possible. Turn a loss landscape around, find its lowest point, and learn why a lowest point may be hard to find, not unique, or missing.25 min · 🎛️ 3D landscape you can rotate

Browse the whole curriculum →

The course

From basic math all the way to how modern LLMs are trained, aligned and served. New lessons are added regularly.

  1. 0Start Here5 of 5 ready
  2. 1Math Foundations49 of 60 ready
  3. 2Programming Toolkit8 lessons · coming soon
  4. 3Classical Machine Learning24 lessons · coming soon
  5. 4Neural Network Foundations1 of 24 ready
  6. 5Computer Vision and CNNs17 lessons · coming soon
  7. 6Sequences and Language Foundations13 lessons · coming soon
  8. 7Transformers15 lessons · coming soon
  9. 8Generative Models16 lessons · coming soon
  10. 9Reinforcement Learning Essentials9 lessons · coming soon
  11. 10Large Language Models44 lessons · coming soon
  12. 11Electives and Advanced Topics11 lessons · coming soon
  13. 12Practical ML Engineering9 lessons · coming soon

Pick a path

Deep Learning CoreThe main path: math you need, neural networks, CNNs, sequences, transformers~100 lessons
Fast Track to LLMsProgrammers who want to understand how LLMs work~55 lessons
Math RefresherYou know ML but forgot the math~60 lessons
Code-First PractitionerEngineers who learn by building~45 lessons