青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

O(1) 的小樂

Job Hunting

公告

記錄我的生活和工作。。。
<2025年9月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

統(tǒng)計(jì)

  • 隨筆 - 182
  • 文章 - 1
  • 評(píng)論 - 41
  • 引用 - 0

留言簿(10)

隨筆分類(70)

隨筆檔案(182)

文章檔案(1)

如影隨形

搜索

  •  

最新隨筆

最新評(píng)論

閱讀排行榜

評(píng)論排行榜

Kullback–Leibler divergence KL散度

In probability theory and information theory, the Kullback–Leibler divergence[1][2][3] (also information divergence,information gain, relative entropy, or KLIC) is a non-symmetric measure of the difference between two probability distributions P and Q. KL measures the expected number of extra bits required to code samples from P when using a code based on Q, rather than using a code based on P. Typically P represents the "true" distribution of data, observations, or a precise calculated theoretical distribution. The measure Q typically represents a theory, model, description, or approximation of P.

Although it is often intuited as a distance metric, the KL divergence is not a true metric – for example, the KL from P to Q is not necessarily the same as the KL from Q to P.

KL divergence is a special case of a broader class of divergences called f-divergences. Originally introduced by Solomon Kullbackand Richard Leibler in 1951 as the directed divergence between two distributions, it is not the same as a divergence incalculus. However, the KL divergence can be derived from the Bregman divergence.

 

 

注意P通常指數(shù)據(jù)集,我們已有的數(shù)據(jù)集,Q表示理論結(jié)果,所以KL divergence 的物理含義就是當(dāng)用Q來編碼P中的采樣時(shí),比用P來編碼P中的采用需要多用的位數(shù)!

 

KL散度,也有人稱為KL距離,但是它并不是嚴(yán)格的距離概念,其不滿足三角不等式

 

KL散度是不對(duì)稱的,當(dāng)然,如果希望把它變對(duì)稱,

Ds(p1, p2) = [D(p1, p2) + D(p2, p1)] / 2

 

下面是KL散度的離散和連續(xù)定義!

D_{\mathrm{KL}}(P\|Q) = \sum_i P(i) \log \frac{P(i)}{Q(i)}. \!

D_{\mathrm{KL}}(P\|Q) = \int_{-\infty}^\infty p(x) \log \frac{p(x)}{q(x)} \; dx, \!

注意的一點(diǎn)是p(x) 和q(x)分別是pq兩個(gè)隨機(jī)變量的PDF,D(P||Q)是一個(gè)數(shù)值,而不是一個(gè)函數(shù),看下圖!

 

注意:KL Area to be Integrated!

 

File:KL-Gauss-Example.png

 

KL 散度一個(gè)很強(qiáng)大的性質(zhì):

The Kullback–Leibler divergence is always non-negative,

D_{\mathrm{KL}}(P\|Q) \geq 0, \,

a result known as , with DKL(P||Q) zero if and only if P = Q.

 

計(jì)算KL散度的時(shí)候,注意問題是在稀疏數(shù)據(jù)集上KL散度計(jì)算通常會(huì)出現(xiàn)分母為零的情況!

 

 

Matlab中的函數(shù):KLDIV給出了兩個(gè)分布的KL散度

Description

KLDIV Kullback-Leibler or Jensen-Shannon divergence between two distributions.

KLDIV(X,P1,P2) returns the Kullback-Leibler divergence between two distributions specified over the M variable values in vector X. P1 is a length-M vector of probabilities representing distribution 1, and P2 is a length-M vector of probabilities representing distribution 2. Thus, the probability of value X(i) is P1(i) for distribution 1 and P2(i) for distribution 2. The Kullback-Leibler divergence is given by:

   KL(P1(x),P2(x)) = sum[P1(x).log(P1(x)/P2(x))]

If X contains duplicate values, there will be an warning message, and these values will be treated as distinct values. (I.e., the actual values do not enter into the computation, but the probabilities for the two duplicate values will be considered as probabilities corresponding to two unique values.) The elements of probability vectors P1 and P2 must each sum to 1 +/- .00001.

A "log of zero" warning will be thrown for zero-valued probabilities. Handle this however you wish. Adding 'eps' or some other small value to all probabilities seems reasonable. (Renormalize if necessary.)

KLDIV(X,P1,P2,'sym') returns a symmetric variant of the Kullback-Leibler divergence, given by [KL(P1,P2)+KL(P2,P1)]/2. See Johnson and Sinanovic (2001).

KLDIV(X,P1,P2,'js') returns the Jensen-Shannon divergence, given by [KL(P1,Q)+KL(P2,Q)]/2, where Q = (P1+P2)/2. See the Wikipedia article for "Kullback–Leibler divergence". This is equal to 1/2 the so-called "Jeffrey divergence." See Rubner et al. (2000).

EXAMPLE: Let the event set and probability sets be as follow:
   X = [1 2 3 3 4]';
   P1 = ones(5,1)/5;
   P2 = [0 0 .5 .2 .3]' + eps;
Note that the event set here has duplicate values (two 3's). These will be treated as DISTINCT events by KLDIV. If you want these to be treated as the SAME event, you will need to collapse their probabilities together before running KLDIV. One way to do this is to use UNIQUE to find the set of unique events, and then iterate over that set, summing probabilities for each instance of each unique event. Here, we just leave the duplicate values to be treated independently (the default):
   KL = kldiv(X,P1,P2);
   KL =
        19.4899

Note also that we avoided the log-of-zero warning by adding 'eps' to all probability values in P2. We didn't need to renormalize because we're still within the sum-to-one tolerance.

REFERENCES:
1) Cover, T.M. and J.A. Thomas. "Elements of Information Theory," Wiley, 1991.
2) Johnson, D.H. and S. Sinanovic. "Symmetrizing the Kullback-Leibler distance." IEEE Transactions on Information Theory (Submitted).
3) Rubner, Y., Tomasi, C., and Guibas, L. J., 2000. "The Earth Mover's distance as a metric for image retrieval." International Journal of Computer Vision, 40(2): 99-121.
4) <a href="
http://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence"&gt;Kullback–Leibler divergence</a>. Wikipedia, The Free Encyclopedia.

posted on 2010-10-16 15:04 Sosi 閱讀(10034) 評(píng)論(2)  編輯 收藏 引用 所屬分類: Taps in Research

評(píng)論

# re: Kullback&ndash;Leibler divergence KL散度 2010-11-30 16:17 tintin0324

博主,本人的研究方向需要了解kl距離,有些問題想請教下,怎么聯(lián)系呢?

# re: Kullback&ndash;Leibler divergence KL散度 2010-12-05 22:37 Sosi

@tintin0324
KL 距離本身很簡單,如果就是那樣子定義的,意義也如上面所說。。如果你想深入了解的話,可以讀以下相關(guān)文獻(xiàn)
統(tǒng)計(jì)系統(tǒng)
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲第一黄色| 国外视频精品毛片| 亚洲天堂黄色| 亚洲无线视频| 国产日韩欧美中文| 麻豆成人91精品二区三区| 老司机午夜精品视频| 亚洲精品中文字幕女同| 一本色道88久久加勒比精品 | 欧美电影在线观看| 欧美成人一区二区三区| 亚洲日本激情| 亚洲午夜激情网站| 一区精品久久| 99riav1国产精品视频| 国产日韩一区在线| 亚洲丁香婷深爱综合| 国产精品xxxxx| 久久免费视频这里只有精品| 欧美岛国在线观看| 欧美一区=区| 欧美国产欧美综合 | 亚洲一二三四久久| 久久国产精品一区二区三区四区| 亚洲欧洲一区| 亚洲欧美一区二区激情| 亚洲欧洲日韩综合二区| 亚洲欧美国产高清va在线播| 亚洲国产欧美国产综合一区| 亚洲一区二区黄| 亚洲欧洲日产国码二区| 小辣椒精品导航| 一区二区av在线| 久久亚洲精品一区二区| 欧美在线黄色| 国产精品xxxav免费视频| 欧美激情国产高清| 国产一区二区三区日韩| 一区二区三区福利| 亚洲精品欧美日韩专区| 久久精彩免费视频| 欧美影院在线播放| 欧美性生交xxxxx久久久| 亚洲国产精品久久91精品| 国产亚洲第一区| 亚洲一级特黄| 亚洲小少妇裸体bbw| 欧美精品久久久久久久久老牛影院| 久久久久久久综合色一本| 国产精品乱人伦一区二区| 亚洲精品中文字幕女同| 亚洲精品国产精品国自产观看浪潮| 久久精品最新地址| 久久蜜桃资源一区二区老牛| 国产麻豆综合| 亚洲男女自偷自拍| 欧美一区二区三区精品| 欧美手机在线视频| 国产精品99久久久久久人| 亚洲视频精选| 欧美亚洲成人免费| 亚洲图片欧美日产| 国产精品亚洲网站| 亚洲影视在线播放| 欧美一区二区视频免费观看| 国产精品日韩一区| 午夜精品亚洲| 久久久水蜜桃| 亚洲国产日韩欧美| 欧美精品三级日韩久久| 亚洲免费福利视频| 午夜亚洲精品| 国产一区自拍视频| 久久综合网络一区二区| 欧美成人午夜视频| 夜夜嗨av一区二区三区四区| 欧美日本一区二区高清播放视频| 一区二区高清| 久久久亚洲成人| 亚洲国产成人精品久久| 欧美精品日韩www.p站| 99国产精品| 久久久91精品国产一区二区三区| 伊人久久婷婷| 欧美日韩国产在线| 亚洲欧美日韩国产综合精品二区| 久久久久女教师免费一区| 亚洲人www| 国产精品午夜电影| 久久久久欧美精品| 亚洲精品久久久久久久久久久久| 亚洲综合精品一区二区| 激情另类综合| 欧美日韩午夜| 久久精品日韩欧美| 日韩视频二区| 欧美fxxxxxx另类| 亚洲一区二区三区精品视频| 国产一区在线视频| 欧美日韩精品二区| 欧美一区二区三区久久精品茉莉花 | 欧美成人69av| 午夜久久tv| 亚洲精品午夜精品| 毛片基地黄久久久久久天堂| 一本大道久久a久久精二百| 国产一区久久久| 欧美午夜精品理论片a级大开眼界 欧美午夜精品理论片a级按摩 | 这里只有精品电影| 在线观看日产精品| 国产欧美精品在线播放| 欧美精品九九| 美日韩丰满少妇在线观看| 亚洲一品av免费观看| 亚洲经典在线| 欧美 日韩 国产 一区| 欧美亚洲视频| 亚洲一级一区| 99国内精品久久| 亚洲区一区二区三区| 国语自产精品视频在线看8查询8 | 欧美一区二区三区免费视频| 亚洲美女视频在线观看| 亚洲国产综合在线| 欧美福利在线观看| 久久一二三区| 久久噜噜亚洲综合| 久久国产精品久久国产精品 | 亚洲三级网站| 亚洲国产精品一区二区www在线| 久久精品青青大伊人av| 午夜精品久久久久久久 | 美女久久网站| 久久综合九色99| 美女日韩欧美| 老**午夜毛片一区二区三区| 久久蜜桃精品| 久久综合久久综合这里只有精品| 久久精品人人做人人综合| 欧美在线观看网站| 欧美一区二视频在线免费观看| 亚洲女人av| 欧美一区二区啪啪| 久久精品最新地址| 久久久久久噜噜噜久久久精品| 久久精品国产成人| 另类av一区二区| 欧美成人精品福利| 亚洲激情精品| 亚洲最新合集| 亚洲自拍偷拍麻豆| 久久大逼视频| 欧美成年人视频网站| 欧美日韩999| 国产精品一二三四| 国语精品中文字幕| 91久久精品国产91久久性色| 99热在这里有精品免费| 亚洲一区二区三区涩| 久久久精品国产免费观看同学| 欧美成人精品一区二区三区| 亚洲黄色成人| 亚洲一区国产| 久久亚洲电影| 欧美日韩一区精品| 国内伊人久久久久久网站视频| 在线观看欧美激情| 宅男66日本亚洲欧美视频| 欧美一区二区三区四区视频| 开元免费观看欧美电视剧网站| 亚洲国产精品成人va在线观看| 一本色道久久综合亚洲精品不卡 | 性欧美大战久久久久久久久| 可以看av的网站久久看| 欧美视频免费看| 一区久久精品| 亚洲综合另类| 欧美高清视频一二三区| 亚洲一级在线观看| 免费在线观看成人av| 国产精品久久久久久久久免费樱桃 | 一区二区精品在线观看| 久久精品九九| 亚洲精品视频在线观看免费| 久久国产直播| 国产精品久久毛片a| 亚洲激情小视频| 久久精品久久99精品久久| 日韩午夜精品| 欧美mv日韩mv国产网站| 国产一区久久久| 午夜精品久久久久久99热| 亚洲第一在线视频| 久久激情视频| 国产美女扒开尿口久久久| av成人动漫| 欧美激情1区2区| 久久国产精品久久精品国产| 国产精品久久久久av| 9久re热视频在线精品|