0
点赞
收藏
分享

微信扫一扫

信息量、信息熵、条件熵、KL散度、交叉熵


文章目录

  • ​​1. 信息量​​
  • ​​2. 信息熵​​
  • ​​3. 条件熵​​
  • ​​4. 交叉熵与KL散度​​
  • ​​4.1 公式推导​​

1. 信息量

  为了理解这个概念,我们先以两个具体的事件为例:

  • 事件1:德国队获得世界杯冠军。
  • 事件2:中国队获得世界杯冠军。

2. 信息熵

  信息熵和信息量只差一个字,它们的区别在哪里呢?个人理解是说,信息量指代的是单个事件,而信息熵指代的是整个系统的数学期望(系统内所有事件)。信息熵的表达式为:

  刚看到信息量和信息熵的时候,不知道你也有类似的疑问,为什么要取对数。网上查了半天,也没有找到答案,最后在香浓的paper(A Mathematical Theory of Communication)找到了解释:

  1. It is practically more useful. Parameters of engineering importance such as time, bandwidth, number of relays, etc., tend to vary linearly with the logarithm of the number of possibilities. For example, adding one relay to a group doubles the number of possible states of the relays. It adds 1 to the base 2 logarithm of this number. Doubling the time roughly squares the number of possible messages, or doubles the logarithm, etc.
  2. It is nearer to our intuitive feeling as to the proper measure. This is closely related to (1) since we intuitively measures entities by linear comparison with common standards. One feels, for example, that
    two punched cards should have twice the capacity of one for information storage, and two identical channels twice the capacity of one for transmitting information.
  3. It is mathematically more suitable. Many of the limiting operations are simple in terms of the logarithm but would require clumsy restatement in terms of the number of possibilities.

  举个例子,假设现有系统是2个硬币,每个硬币往上抛一下,则信息熵为

  假如在现有系统上加入一个硬币,则信息熵为

可见信息熵随着系统规模的线性增加而呈现线性增长。

,第二个硬币正面朝上和朝下的概率分别为

  可见信息熵代表了一个线性系统(线性相加和数乘)。

  参考链接:https://stats.stackexchange.com/questions/87182/what-is-the-role-of-the-logarithm-in-shannons-entropy

3. 条件熵

信息量、信息熵、条件熵、KL散度、交叉熵_概率论_11

4. 交叉熵与KL散度

  (original bits) + (extra bits) = (total bits).

The (extra bits) part为KL散度,通常用来测量两个分布之间的距离 ,也称作为相对熵:

4.1 公式推导


  Q:为什么要将KL散度表示成交叉熵-信息熵的形式呢?

  主要为以下两大原因:

  1. 为0时,KL散度均为0,无法体现出真实值与预测值之间的差异。
  2. 由于是已知量,则信息熵是确定的,所以求交叉熵能够在某种程度上减少运算量,即将转换为了

参考链接:


  • ​​https://towardsdatascience.com/entropy-cross-entropy-and-kl-divergence-explained-b09cdae917a​​


举报

相关推荐

0 条评论