Below is a transcript of a video lecture. Please convert this transcript into study…
- User
Below is a transcript of a video lecture. Please convert this transcript into study notes, highlighting the main concepts, key terms, and important details. Organize the notes with bullet points or headings for clarity, ensuring they are easy to review. Focus on summarizing the content effectively while maintaining the essence of the information presented:
In Machine Learning, cross-entropy is very commonly used as a cost function when training classifiers and so we’ll see why that is. Those concepts come from Claude Shannon’s Information Theory. Shannon was an American mathematician, electrical engineer, and cryptographer. And in his 1948 paper “A Mathematical Theory of Communication” he founded what is now known as Information Theory. The goal is to reliably and efficiently transmit a message from a sender to a recipient. In our digital age, messages are composed of bits. Of course you know that a bit is a number that is either equal to 0 or 1. But not all bits are useful: some of them are redundant, some of them are errors, and so on. So when we communicate a message, we want as much useful information as possible to get through. In Shannon’s theory, to transmit one bit of information means to reduce the recipient’s uncertainty by a factor of 2. For example, say that the weather is completely random, with a 50/50 chance of being either sunny or rainy every day. If a weather station tells you that it’s going to be rainy tomorrow then they have actually reduced your uncertainty by a factor of two. There were two equally likely options, now there is just one. So the weather channel actually sent you a single bit of useful information. And this is true no matter how they encoded this information. If they encoded it as a string, with 5 characters, each encoded on 1 byte, then they actually sent you a 40 bit message, but they still only communicated 1 bit of useful information.
Now suppose the weather has actually 8 possible states, all equally likely. Now when the weather station gives you tomorrow’s weather, they are dividing your uncertainty by a factor of 8, which is 2 to the power of 3. So they sent you 3 bits of useful information. It’s easy to find the number of bits of information that were actually communicated by computing the binary logarithm of the uncertainty reduction factor, which in this example is 8,
But what if the possibilities are not equally likely? Say 75% chance sunny, and 25% chance rainy. If the weather station tells you it’s going to be rainy tomorrow, then your uncertainty has dropped by a factor of 4, which is 2 bits of information. The uncertainty reduction is just the inverse of the event’s probability, in this case the inverse of 25% is 4. Now the log of 1/x is equal to -log(x), so the equation to compute the number of bits simplifies to minus the binary log of the probability, 25%. Now if the weather station tells you it’s going to be sunny tomorrow then your uncertainty hasn’t dropped much. In fact, you get just over .41 bits of information. So how much information are you actually going to get from the weather station, on average? Well, there’s a 75% chance that it will be sunny tomorrow, so that’s what the weather station would tell you and that’s .41 bits of information. Then there’s a 25% chance that it will be rainy, in which case the weather station will tell you so, and this will give you 2 bits of information. So on average, you will get .81 bits of information from the weather station, every day. So what we just computed is called the Entropy. It is a nice measure of how uncertain the events are. Hopefully the Entropy’s equation should now make complete sense: it measures the average amount of information that you get when you learn the weather each day, or more generally the average amount of information that you get from one sample drawn from a given probability distribution p. It tells you how unpredictable that probability distribution is. If you live in the middle of a desert where it’s sunny every day, on average you won’t get much information from the weather station. The entropy will be close to zero. Conversely, if the weather varies a lot, the entropy will be much larger.
- Assistant