3
在实践中计算Kullback-Leibler散度?
我使用KL散度作为2 之间差异的量度。米。f 。p.m.f.p.m.f.p.m.f. PPP和QQQ。 DKL(P||Q)=∑i=1Nln(PiQi)PiDKL(P||Q)=∑i=1Nln(PiQi)PiD_{KL}(P||Q) = \sum_{i=1}^N \ln \left( \frac{P_i}{Q_i} \right) P_i =−∑P(Xi)ln(Q(Xi))+∑P(Xi)ln(P(Xi))=−∑P(Xi)ln(Q(Xi))+∑P(Xi)ln(P(Xi))=-\sum P(X_i)ln\left(Q(X_i)\right) + \sum P(X_i)ln\left(P(X_i)\right) 如果P(Xi)=0P(Xi)=0P(X_i)=0 那么我们可以轻松地计算出 P(Xi)ln(Q(Xi))=0P(Xi)ln(Q(Xi))=0P(X_i)ln\left(Q(X_i)\right)=0 P(Xi)ln(P(Xi))=0P(Xi)ln(P(Xi))=0P(X_i)ln\left(P(X_i)\right)=0 但是,如果且Q (X i)= 0,则 如何计算P (X i)l n ( Q (X i))P(Xi)≠0P(Xi)≠0P(X_i)\ne0Q(Xi)=0Q(Xi)=0Q(X_i)=0P(Xi)ln(Q(Xi))P(Xi)ln(Q(Xi))P(X_i)ln\left(Q(X_i)\right)