1. 概述

KL散度存在不对称性，为解决这个问题，在KL散度基础上引入了JS散度。

$J S\left(P_{1} \| P_{2}\right)=\frac{1}{2} K L\left(P_{1} \| \frac{P_{1}+P_{2}}{2}\right)+\frac{1}{2} K L\left(P_{2} \| \frac{P_{1}+P_{2}}{2}\right)$

JS散度的值域范围是[0,1]，相同则是0，相反为1

2. 性质

KL散度和JS散度度量的时候有一个问题：

3. 证明

\begin{aligned} JS(P \| Q) &= \frac{1}{2} K L\left(P_{1} \| \frac{P_{1}+P_{2}}{2}\right)+\frac{1}{2} K L\left(P_{2} \| \frac{P_{1}+P_{2}}{2}\right) \\ &=\frac{1}{2} \sum p(x) \log \left(\frac{p(x)}{\frac{p(x)+q(x)}{2}}\right)+\frac{1}{2} \sum q(x) \log \left(\frac{q(x)}{\frac{p(x)+q(x)}{2}}\right) \\ &=\frac{1}{2} \sum p(x) \log \left(\frac{2 p(x)}{p(x)+q(x)}\right)+\frac{1}{2} \sum q(x) \log \left(\frac{2 q(x)}{p(x)+q(x)}\right) \\ &=\frac{1}{2} \sum p(x) \log \left(\frac{p(x)}{p(x)+q(x)}\right)+\frac{1}{2} \sum q(x) \log \left(\frac{q(x)}{p(x)+q(x)}\right)+\log 2 \end{aligned}

p(x)=0时

\begin{aligned} JS(P \| Q) &=\frac{1}{2} \sum p(x) \log \left(\frac{p(x)}{p(x)+q(x)}\right)+\frac{1}{2} \sum q(x) \log \left(\frac{q(x)}{p(x)+q(x)}\right)+\log 2 \\ &=\frac{1}{2} \sum 0 \times \log \left(\frac{0}{0+q(x)}\right)+\frac{1}{2} \sum q(x) \log \left(\frac{q(x)}{0+q(x)}\right)+\log 2 \\ &= \log 2 \end{aligned}

q(x)=0时

\begin{aligned} JS(P \| Q) &=\frac{1}{2} \sum p(x) \log \left(\frac{p(x)}{p(x)+q(x)}\right)+\frac{1}{2} \sum q(x) \log \left(\frac{q(x)}{p(x)+q(x)}\right)+\log 2 \\ &=\frac{1}{2} \sum p(x) \log \left(\frac{p(x)}{p(x)+0}\right)+\frac{1}{2} \sum 0 \times \log \left(\frac{0}{p(x)+0}\right)+\log 2 \\ &=\log 2 \end{aligned}

参考链接

posted @ 2021-06-14 18:19  MorStar  阅读(60)  评论(0编辑  收藏  举报