Cross-Entropy, Exactly
Every term of the cross-entropy formula from one-hot and soft targets to softmax gradients, with live tensors and checked exercises.
Cross-entropy term by term
Inspect target weights, logarithms, candidate distributions, batch averages, and softmax gradients.
- What Cross-Entropy Measures
why expected surprise splits into irreducible entropy plus mismatch
- One-Hot Selects One Term
why hard labels collapse the cross-entropy sum to a single log-probability
- Soft Targets Weight Terms
how soft targets bring every class back into the cross-entropy sum
- Log Is the Named Boundary
why the logarithm creates an infinite barrier at zero probability
- Lower Probability, Higher Loss
why multiplicative drops in probability become additive steps in cross-entropy
- Compare Two Candidate Distributions
why a candidate that is confident on the top class can still lose on cross-entropy
- Average Over a Tiny Batch
how positive and negative rows combine into a single batch mean loss
- Cross-Entropy and Softmax
how softmax and negative log-probability combine into the linear gradient p - y
- What Cross-Entropy Is and Is Not
why even an exact probability model has positive cross-entropy on noisy outcomes