What is entropy?
The average surprise of a distribution, in bits. It is zero when one outcome is certain and largest when all are equally likely.
Where it is taught
Entropy and information. How much uncertainty a distribution holds, measured in bits. It explains where the name cross-entropy comes from and what a loss value is really counting.
What the lesson leaves you with
- An outcome with probability carries bits.
- Entropy is the average surprise of a distribution.
- Cross-entropy is the surprise when you believe and the truth is . It is lowest when they match.
Questions
- What is entropy?
- The average surprise of a distribution, -sum p log_2 p in bits. It is zero when one outcome is certain and largest when all are equally likely.
- Where is entropy used in AI?
- How much uncertainty a distribution holds, measured in bits. It explains where the name cross-entropy comes from and what a loss value is really counting.
- What is the key idea to remember about entropy?
- An outcome with probability <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="katex-base"><span class="katex-strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span></span></span></span> carries <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><msub><mrow><mi>log</mi><mo></mo></mrow><mn>2</mn></msub><mi>p</mi></mrow><annotation encoding="application/x-tex">-log_2 p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="katex-base"><span class="katex-strut" style="height:0.9386em;vertical-align:-0.2441em;"></span><span class="mord">−</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop"><span class="mop">lo<span style="margin-right:0.0139em;">g</span></span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.207em;"><span style="top:-2.4559em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="katex-sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.2441em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">p</span></span></span></span> bits.
- Where can I learn entropy step by step?
- In the lesson “Entropy and information” in Gradient’s course on the maths behind AI, with interactive diagrams and questions.