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.
Welcome back. Continue “” →
- Free forever. No paywall, no sign-up.
- Works on your phone, even on slow data. Turn on Lite Mode in settings.
- Private. Your progress stays on your device.
- Three depths in every lesson: Intuition, Math and Code.
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.P1.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.P1.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.P1.F3Gradient descentWalk downhill one step at a time. The algorithm that trains nearly every neural network, and why the step size matters so much.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.P1.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.
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".P0.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.P0.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.P0.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.P1.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.
The course
From basic math all the way to how modern LLMs are trained, aligned and served. New lessons are added regularly.
- 0Start Here
- 1Math Foundations
- 2Programming Toolkit
- 3Classical Machine Learning
- 4Neural Network Foundations
- 5Computer Vision and CNNs
- 6Sequences and Language Foundations
- 7Transformers
- 8Generative Models
- 9Reinforcement Learning Essentials
- 10Large Language Models
- 11Electives and Advanced Topics
- 12Practical ML Engineering
Pick a path
Deep Learning CoreThe main path: math you need, neural networks, CNNs, sequences, transformers
Fast Track to LLMsProgrammers who want to understand how LLMs work
Math RefresherYou know ML but forgot the math
Code-First PractitionerEngineers who learn by building