<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>KL Divergence on Haleuan&#39;s Blog</title>
    <link>https://haleuan.github.io/en/tags/kl-divergence/</link>
    <description>Recent content in KL Divergence on Haleuan&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sat, 03 May 2025 15:59:21 +0800</lastBuildDate>
    <atom:link href="https://haleuan.github.io/en/tags/kl-divergence/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>KL Divergence and Cross Entropy</title>
      <link>https://haleuan.github.io/en/post/kl%E6%95%A3%E5%BA%A6%E5%92%8C%E4%BA%A4%E5%8F%89%E7%86%B5%E6%8D%9F%E5%A4%B1%E5%87%BD%E6%95%B0/</link>
      <pubDate>Sat, 03 May 2025 15:59:21 +0800</pubDate>
      <guid>https://haleuan.github.io/en/post/kl%E6%95%A3%E5%BA%A6%E5%92%8C%E4%BA%A4%E5%8F%89%E7%86%B5%E6%8D%9F%E5%A4%B1%E5%87%BD%E6%95%B0/</guid>
      <description>&lt;h2 id=&#34;kl-divergence-kullback-leibler-divergence-kld&#34;&gt;KL Divergence (Kullback-Leibler Divergence, KLD)&lt;/h2&gt;
&lt;p&gt;Suppose we have two coins:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A fair coin with the following probability distribution:&lt;br&gt;

$$P=\begin{cases}&amp;0.5,&amp;\text{Heads} \\ &amp;0.5, &amp;\text{Tails}\end{cases}$$&lt;/li&gt;
&lt;li&gt;A biased coin with the following probability distribution:&lt;br&gt;

$$Q=\begin{cases}&amp;0.9,&amp;\text{Heads} \\ &amp;0.1, &amp;\text{Tails}\end{cases}$$&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;How can we describe the difference between these two distributions? More importantly, how can we &lt;strong&gt;quantify&lt;/strong&gt; this difference?&lt;/p&gt;
&lt;p&gt;KL divergence allows us to quantify the difference (or similarity) between two distributions. It measures how one probability distribution $Q(x)$ diverges from a reference distribution $P(x)$, and is defined as:&lt;br&gt;
&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
