Odds and surprise: probability and information for ML
How It Learns · Open board
The How It Learns board. Its loop ends in a number called the loss. This lesson explains why, for a model that picks one answer from many, that number is cross-entropy and not something simpler.
A spam filter reads an email that has the word “lottery” in it. Before the word, the email looked fine. After it, the filter must change its mind by the right amount. Too little and spam gets through. Too much and your bank’s real email goes to junk.
A model that picks the next word has the same problem. It gives each word a chance, and then the real word arrives. It needs one number that says how wrong the chances were, and one it can lower by small steps.
By the end you will be able to explain, with numbers, why that number is cross-entropy.
The history (optional)
Richard Price had Thomas Bayes’s essay read to the Royal Society on 23 December 1763, two years after Bayes died. Claude Shannon published the bit and entropy in the Bell System Technical Journal in July and October 1948. Solomon Kullback and Richard Leibler published their gap measure in 1951. Nothing below depends on these dates.
Before you start.Vectors, Dot Products and Matrix Multiply showed that a layer ends in plain numbers, one score per possible answer. What a Neural Network Is showed a network as weights that get adjusted until its answers are good. Here is the one fact you need from probability: a list of chances is a list of numbers from 0 to 1 that add up to exactly 1. This lesson uses only that, plus multiply, divide and add.
Lesson 3 of 83 in AI · Free with an account
Keep reading. It's free.
A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.
No card, and chalk sends no email. Google sign-in only.