Maximum Likelihood: Fitting Frequencies

A tiny generator with two outputs, A and B. Learning = finding the probability a = p(A) that makes the observed data most likely.

Training data
Observations n
How many are A
Sample from the fitted model
Average negative log-likelihood J(a) (in nats, lower is better) · drag on the chart to move a
a = p(A)
Loss J(a)
Derivative J′(a): the slope
Second derivative J″(a)
always > 0: the curve bends upward, so the zero of J′ is a minimum
Training vs. held-out data
True population probability of A π
Training NLL
on the observed data
Held-out NLL
expected on new data
Best possible held-out
if a were exactly π