Log inStart free
LESSON 5.09 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Cross-entropy losses

Watch scores become probabilities, and see why sure, wrong guesses cost the most.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 5.09 · LOSS BAYSCORES −1.00, 2.00, 1.00
01
Stage 1 of 6 · The scores
The last layer gives one raw score, a logit, per label. A score can be any number.
Explain it simply

Each row is one label, numbered 1 to 3. The bar on the left is the label's score, a plain number from the network. A score can be negative or larger than 1, so it is not a probability yet. The next stage turns the scores into probabilities.

Three labels with scores −1.00, 2.00, 1.00.

The scores are picked by hand, not trained.
scores, probabilitiestargetloss, gradient0 to 1 track
label 1label 2label 3−1.002.001.00score zThe scoresz = (−1.00, 2.00, 1.00)label 1label 2label 3−1.002.001.00score zThe scoresz = (−1.00, 2.00, 1.00)
Toy: 1 example, 3 labels, picked scores
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
z=(z1,z2,z3)\sy{z}{out}{\mathbf z} = (\sy{z}{out}{z_1}, \sy{z}{out}{z_2}, \sy{z}{out}{z_3})
z=(−1.00,2.00,1.00)z = (-1.00, 2.00, 1.00)

One raw score per label.

Common mix-ups

MYTHSoftmax works for multilabel tasks too.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With a sigmoid output layer, do the three probabilities still sum to 1?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.