QuiddityML

17 September 2026 · how-to-learnmath

How much math do you actually need for machine learning?

You need enough math to read a loss function, an update rule, and a shape error, and that is a list you can finish in a few weeks. This post names every piece, says which ones you need before your first model and which can wait, and estimates the hours.

You need enough math to read a loss function, an update rule, and a shape error, and to know why training broke when it does. That is a list of around 130 ideas across six areas, and most of them come up within the first month of doing ML. This post names every idea on the list, splits it into what you need before your first model and what can wait until a lesson needs it, and puts hours on each part.

Learn the math in context, not up front

Many people quit while working through three courses and a textbook before touching a model, and the math learned that way tends not to stick. A derivative learned from a chapter with no model attached is usually gone in a week. The same derivative learned the day you watch it move a weight in a training loop stays, because it has a use.

The better order is to get the notation and the core of each area down, which takes a few weeks, start ML, and pick up the rest of the math where it comes up, attached to the model that needs it. There is always more math to learn in this field, and learning it when a model asks for it is what makes it stay.

Why the question feels bigger than it is

Universities front-load a year of math before the first model. Job posts say "strong math background" without saying for what. Papers use notation that most courses skip, so a page of Greek letters reads as hard math when much of it is shorthand. Once the shorthand is learned, most equations in ML turn out to be a sum, a product, and a log.

The six areas, split by when you need them

Each area below lists the ideas you should have before your first model, then the ones that can wait until a lesson uses them. The hours assume high-school math and no prior exposure.

Notation toolkit (about 1 week, all of it before)

Functions, composition, and inverses. Exponents and logarithms. Trig functions and the unit circle. Summation and product notation. Argmin and argmax. Hat, tilde, and bar notation. The update arrow. Set membership and shape notation. Combinatorics. Big-O notation.

This is how math is written rather than math itself, and skipping it is a common reason equations look scary. A lot of "I can't read papers" comes down to this list.

Linear algebra (about 3 weeks)

Before your first model: scalars, vectors, and matrices. Matrix multiplication as a map, and the shape rule that goes with it. Transpose. The dot product. Norms, lengths, and distances. Angles and cosine similarity. Tensors and tensor operations. Broadcasting.

When it comes up: span, basis, and linear independence. Systems of linear equations. Determinant, inverse, and singular matrices. Rank, column space, and null space. Trace. Orthogonality and orthogonal matrices. Projections, orthonormal bases, and least squares. Eigenvalues and eigenvectors, change of basis, eigendecomposition. Positive semi-definite matrices. Singular value decomposition and low-rank approximation. QR and Cholesky factorizations. Einsum notation.

Calculus and optimization (about 2 weeks)

Before your first model: limits and continuity, the derivative, partial derivatives, the gradient, the chain rule, and what automatic differentiation does for you.

When it comes up: the Jacobian, matrix calculus, backpropagation through a linear layer, the Hessian, Taylor expansion and linearization, convex functions and sets, critical points, local minima and saddle points, and the eigenvalue test for definiteness.

The gradient says which way to move each parameter, and the chain rule is how that gradient gets through a stack of layers. You need the idea firmly, and the framework does the arithmetic.

Probability and statistics (about 3 weeks)

Before your first model: random variables and distributions, probability mass versus density, joint, marginal, and conditional probability, independence, Bayes' theorem, expectation and variance, the Gaussian, and maximum likelihood estimation.

When it comes up: the sum and product rules, the union bound, the chain rule of probability. Bernoulli, binomial, Poisson, Beta, the exponential family, kernel density estimation, the CDF, and percentiles. Moments, covariance and correlation, conditional expectation, the multivariate Gaussian and covariance matrices, Mahalanobis distance. The law of large numbers, the central limit theorem, standard error, confidence intervals, hypothesis tests and p-values. Maximum a posteriori estimation, Bayesian inference, priors, posteriors, the posterior predictive, conjugate priors, and the bias and variance of an estimator. Monte Carlo estimation, importance and rejection sampling, Markov chain Monte Carlo, the reparameterization trick, and the bootstrap.

Most loss functions come from a probabilistic assumption. Mean squared error assumes Gaussian noise, cross-entropy is maximum likelihood on a categorical distribution, and evaluation is statistics. The "before" group is what it takes to see that.

Information theory (about 3 days, all of it before)

Self-information, entropy, differential entropy, the maximum entropy principle, cross-entropy, KL divergence, and mutual information.

Cross-entropy, the usual loss for classification, comes out of this.

Numerical computation (about 2 days, all of it before)

Floating-point representation, overflow and underflow in exponentials, the log-sum-exp trick, and the exponential moving average.

This is why a loss turns into NaN, why softmax is computed on shifted logits, and why Adam has bias correction.

A timeline of the six math areas to learn before a first model, each with its topics and hours, ending at the point where ML starts.

Where each piece shows up in ML

ML idea Math it needs
Softmax exponents, logs, log-sum-exp
Cross-entropy loss entropy, maximum likelihood
Backpropagation chain rule, Jacobian
Adam optimizer exponential moving average
Attention dot product, softmax, matrix shapes
Embeddings cosine similarity, norms
Batch normalization mean, variance
PCA covariance, eigendecomposition
Reporting a result standard error, confidence intervals

Nine ML ideas on the left each connected to the one or two pieces of math they depend on.

What to skip unless you go into research

Proofs. Real analysis. Measure-theoretic probability. Most of integral calculus beyond knowing what an integral is. Closed-form derivations of estimators. Anything that only appears in the appendix of a paper. If you later move toward research, custom losses, probabilistic models, or the theory side of reinforcement learning, these come back on the list, and a paper will tell you which ones.

Time

The basics above add up to about 60 to 80 hours, which is 6 to 10 weeks at around an hour a day, and Python can be learned in parallel.

How to learn it so it stays

For the basics, write each idea in NumPy or PyTorch the same day you learn it: a dot product, a gradient of a two-weight function, a mean and variance. For everything after, learn it next to the model that needs it and revisit it once you have used it. A derivative you computed by hand for a two-weight model and then watched PyTorch reproduce is one you tend to keep, and one read in a chapter and left there usually is not.

Three signs you have enough to start ML: you can read the cross-entropy formula and say why it has a log in it, you can explain why the gradient points uphill and the update goes the other way, and you can predict the shape of a matrix product before running it.

QuiddityML's Math track covers the six areas above as short lessons with a code exercise per idea, it is free, and the ML lessons teach the rest of the math where it comes up, so the "when it comes up" column arrives attached to the model that needs it (quiddityml.com).