Archive — one question answered
Loss: cross-entropy for classification
Why cross-entropy instead of (1 − p)² when labels are 0 or 1?
For binary label and predicted probability , binary cross-entropy is:
If and the model outputs , — nearly correct. Same label with (confidently wrong) gives — a loud penalty.
Versus when : at the square is only , not loud enough to fix weights. Log loss punishes overconfident mistakes harder.
Two spam emails ():
| 0.9 | 0.11 |
| 0.1 | 2.30 |
Mean loss over both is . That is how the Deep Learning track scores “how bad” a classifier is before you write backward. Pair cross-entropy with sigmoid outputs so every prediction lives in and the loss stays finite; mixing logits with MSE is legal but the course stays with the classic classification pair for the spam neuron. Watch the training log: a confident wrong on a positive label should spike loss faster than a gentle mistake.