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

O(1) 的小樂

Job Hunting

公告

記錄我的生活和工作。。。
<2025年11月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

統計

  • 隨筆 - 182
  • 文章 - 1
  • 評論 - 41
  • 引用 - 0

留言簿(10)

隨筆分類(70)

隨筆檔案(182)

文章檔案(1)

如影隨形

搜索

  •  

最新隨筆

最新評論

閱讀排行榜

評論排行榜

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通常指數據集,我們已有的數據集,Q表示理論結果,所以KL divergence 的物理含義就是當用Q來編碼P中的采樣時,比用P來編碼P中的采用需要多用的位數!

 

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

 

KL散度是不對稱的,當然,如果希望把它變對稱,

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

 

下面是KL散度的離散和連續定義!

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, \!

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

 

注意:KL Area to be Integrated!

 

File:KL-Gauss-Example.png

 

KL 散度一個很強大的性質:

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.

 

計算KL散度的時候,注意問題是在稀疏數據集上KL散度計算通常會出現分母為零的情況!

 

 

Matlab中的函數:KLDIV給出了兩個分布的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 閱讀(10051) 評論(2)  編輯 收藏 引用 所屬分類: Taps in Research

評論

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

博主,本人的研究方向需要了解kl距離,有些問題想請教下,怎么聯系呢?
  回復  更多評論    

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

@tintin0324
KL 距離本身很簡單,如果就是那樣子定義的,意義也如上面所說。。如果你想深入了解的話,可以讀以下相關文獻
  回復  更多評論    
統計系統
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            国产免费亚洲高清| 久久久久国产一区二区| 篠田优中文在线播放第一区| 欧美激情在线有限公司| 国产婷婷97碰碰久久人人蜜臀| 亚洲另类在线一区| 久久久蜜桃精品| 亚洲午夜av电影| 欧美区一区二| 亚洲国产欧美日韩另类综合| 欧美在线亚洲在线| 亚洲精品中文字幕有码专区| 久久久亚洲午夜电影| 国产精品亚发布| 中文亚洲免费| 最新国产成人av网站网址麻豆| 亚洲综合精品四区| 欧美日韩免费在线观看| 亚洲欧洲日产国产综合网| 久久免费99精品久久久久久| 亚洲资源在线观看| 欧美日韩中文字幕综合视频| 亚洲伦理在线观看| 欧美电影电视剧在线观看| 欧美一级在线亚洲天堂| 国产精品久久久久一区二区三区共| 日韩视频中文字幕| 欧美激情视频免费观看| 久久久人成影片一区二区三区观看| 国产日韩欧美麻豆| 欧美一区二区三区电影在线观看| 在线视频一区观看| 欧美涩涩网站| 亚洲丝袜av一区| 亚洲精品视频免费观看| 欧美粗暴jizz性欧美20| 亚洲二区在线视频| 免费在线播放第一区高清av| 久久精品成人欧美大片古装| 国产一区二区精品久久99| 欧美一区二区视频在线观看| 亚洲永久字幕| 国产精一区二区三区| 性欧美在线看片a免费观看| 亚洲午夜免费福利视频| 国产精品久久国产精品99gif| 亚洲天堂网站在线观看视频| 99热在线精品观看| 国产精品电影在线观看| 亚洲欧美日本另类| 亚洲一区二区三区视频播放| 国产精品男gay被猛男狂揉视频| 亚洲欧美电影在线观看| 亚洲一区在线播放| 国产美女精品视频| 久久精品人人做人人爽电影蜜月| 欧美在线你懂的| 国语精品一区| 免费成人高清| 欧美va天堂在线| 亚洲最新在线视频| 一区二区三区日韩欧美精品| 国产精品美女主播| 久久精品99国产精品日本| 久久er精品视频| 亚洲第一区在线| 亚洲国产黄色| 欧美日韩精品免费观看视频| 亚洲男人的天堂在线观看| 亚洲男人的天堂在线观看| 国产一区二区三区日韩欧美| 久久蜜臀精品av| 免费在线亚洲| 亚洲无玛一区| 午夜精品www| 在线观看日韩av电影| 亚洲国产欧美一区| 欧美网站在线观看| 欧美专区一区二区三区| 久久久亚洲成人| 99在线热播精品免费| 亚洲天堂成人在线观看| 国内精品国产成人| 亚洲激精日韩激精欧美精品| 国产精品黄色| 久久久综合激的五月天| 欧美+亚洲+精品+三区| 亚洲天堂视频在线观看| 欧美中文在线观看国产| 亚洲精品乱码久久久久久黑人| 一区二区精品| 精品999在线观看| 亚洲日本欧美日韩高观看| 国产精品一区二区黑丝| 女人香蕉久久**毛片精品| 欧美日韩高清在线一区| 欧美与欧洲交xxxx免费观看| 久热精品视频在线免费观看| 亚洲网站在线观看| 久久精品亚洲一区二区三区浴池| 日韩视频在线一区| 亚洲欧美在线x视频| 91久久亚洲| 亚洲欧美日韩国产中文| 亚洲黄色一区二区三区| 亚洲一区在线视频| 亚洲黄色成人| 亚洲欧美激情视频在线观看一区二区三区| 在线精品亚洲一区二区| 亚洲香蕉网站| 亚洲精品国产精品国自产观看浪潮 | 亚洲经典三级| 国产精品丝袜白浆摸在线| 欧美福利视频一区| 国产精品一二| 亚洲国产精品久久91精品| 国产日韩欧美91| 亚洲美女免费精品视频在线观看| 韩国av一区二区三区四区| 一本色道久久加勒比精品| 亚洲二区免费| 羞羞视频在线观看欧美| 一区二区三区四区国产| 久久理论片午夜琪琪电影网| 亚洲自拍偷拍视频| 欧美成人免费播放| 久久久最新网址| 国产精品麻豆成人av电影艾秋| 亚洲国产精品视频一区| 国产主播在线一区| 国产精品99久久久久久人| 亚洲日本激情| 久久久久久国产精品mv| 性做久久久久久免费观看欧美| 欧美激情在线有限公司| 欧美不卡高清| 黄色另类av| 亚洲欧美偷拍卡通变态| 亚洲图片在线观看| 欧美黑人多人双交| 欧美+日本+国产+在线a∨观看| 国产视频久久久久| 在线视频亚洲一区| 国产精品99久久久久久久久久久久| 免费观看30秒视频久久| 久久综合色播五月| 国产色爱av资源综合区| 亚洲午夜精品久久| 一区二区三区久久网| 欧美国产乱视频| 欧美电影资源| 一区二区视频在线观看| 欧美一区二区在线| 欧美怡红院视频| 国产精品区一区二区三区| 一本一本久久a久久精品综合妖精 一本一本久久a久久精品综合麻豆 | 欧美专区在线观看| 久久www成人_看片免费不卡 | 亚洲欧美成aⅴ人在线观看| 欧美日韩国产影院| 亚洲日本电影| a4yy欧美一区二区三区| 欧美激情网站在线观看| 亚洲高清在线观看| 亚洲激精日韩激精欧美精品| 久久久亚洲综合| 欧美成人精品h版在线观看| 影音先锋国产精品| 久久女同互慰一区二区三区| 久久综合九色综合网站| 狠狠爱成人网| 久久久久久久久蜜桃| 免费视频一区| 亚洲电影有码| 欧美1区视频| 亚洲人成7777| 中日韩高清电影网| 国产精品a级| 亚洲一区二区三区涩| 欧美伊久线香蕉线新在线| 国产午夜精品一区二区三区欧美| 欧美一区二区三区免费视| 久久久亚洲一区| 亚洲国产精品久久久久婷婷884 | 久久女同互慰一区二区三区| 欧美aⅴ一区二区三区视频| 亚洲国产视频一区| 欧美激情精品久久久久久大尺度| 亚洲欧洲在线播放| 亚洲一区欧美二区| 国产精品一区免费观看| 欧美一区二区女人| 噜噜噜噜噜久久久久久91| 亚洲国产老妈| 欧美日韩国产首页| 亚洲伊人久久综合| 久久中文字幕一区| 亚洲精品日韩久久| 欧美天堂亚洲电影院在线播放| 亚洲一区三区视频在线观看|