Boost.Math
Boost.Math is a comprehensive mathematics library that goes far beyond what `` provides.
Boost.Math is a comprehensive mathematics library that goes far beyond what `` provides.
Training a model is repeated use of one operation: measure the slope of the loss with respect to each parameter, then step in the direction that makes the loss smaller. Every optimiser in this knowledge base — from plain gradient descent to Adam — is a variation on that one move. This page derives the machinery once so later pages can use it without re-deriving it.
"How many ways" questions tempt a direct answer: generate every arrangement, every selection, every
Beyond dense linear algebra and deep learning, four more CUDA libraries cover the numerical building blocks that show up constantly but rarely justify a hand-written kernel: Fourier transforms, random number generation, sparse linear algebra, and dense/sparse factorizations. Each has its own handle type and its own lifecycle, but — as the closing section here makes explicit — they share more structure with each other, and with cuBLAS, than the four separate APIs first suggest.
The greatest common divisor looks like a problem for factoring both numbers and comparing their
Cross-entropy is the default classification loss for a precise reason: it measures how many extra bits you waste describing reality with the wrong distribution, and minimising it means matching the truth. This page builds entropy, cross-entropy, and KL divergence from scratch so that reason stops being a slogan and becomes a derivation.
A layer in a neural network, a linear regression model, and a batch of predictions being computed all at once are the same operation: multiply a matrix by a vector (or another matrix). Nearly every piece of notation in this knowledge base is linear algebra, so this page fixes the vocabulary once.
Every algorithm folder so far has assumed arithmetic just works: a hash function combines numbers,
Testing whether a single number n is prime is a small, self-contained problem: try dividing it by
A classifier doesn't output "the answer" — it outputs a belief, expressed as a probability distribution over possible answers. Every loss function in this knowledge base is a statement about how that belief compares to reality. This page is the probability vocabulary everything downstream assumes you already have.
A deterministic algorithm has exactly one worst case, and if that worst case is realistic — an
Fitting a model is estimating parameters from a finite sample — and every estimate comes with uncertainty about how wrong it might be. This page derives maximum likelihood estimation, the principle underlying nearly every loss function used in this knowledge base, and shows the bridge from "most likely parameters" to "squared error" and "cross-entropy."