交叉熵概念

信息量

概率可能性的投影空间大小,单位比特。记随机离散变量的分布列与信息量I为:
[ x 0 x 1 . . . x n p 0 p 1 . . . p n ] I ( x i ) = − l o g ( p ( x i ) ) \begin{alignedat}a &\begin{bmatrix} x_0 & x_1 & ... &x_n\\ p_0 & p_1 & ... &p_n \end{bmatrix}\\\\ &I(x_i) = -log(p(x_i)) \end{alignedat} [x0p0x1p1......xnpn]I(xi)=log(p(xi))

熵(Entropy):一个系统所有事件的不确定性之和;
相对熵(Relative Entropy):同一个随机变量的两个不同分布间的差别描述;
交叉熵(Cross Entropy):使用分布 q ( x ) q(x) q(x)表示目标分布 p ( x ) p(x) p(x)的困难程度,以分布 q q q描述拟合分布 p p p
H ( x ) = E ( L e n b i t ) = E ( l o g ( 1 p i ) ) = − ∑ i = 1 n p i l o g ( p i ) D K L ( p ∣ ∣ q ) = ∑ i = 1 n p i l o g ( p i q i ) = ∑ i = 1 n p i ( l o g ( p i ) − l o g ( q i ) ) H ( p , q ) = E ( L e n b i t ) = E ( l o g ( 1 q i ) ) = − ∑ i p i l o g ( q i ) \begin{alignedat}a H(x) &= E(Len_{bit}) = E(log({1\over p_i})) = - \sum_{i=1}^np_ilog(p_i)\\ D_{KL}(p||q) &= \sum_{i=1}^np_ilog({p_i \over q_i}) = \sum_{i=1}^np_i(log(p_i)-log(q_i))\\ H(p,q) &= E(Len_{bit}) = E(log({1\over q_i})) = -\sum_{i}p_ilog(q_i) \end{alignedat} H(x)DKL(pq)H(p,q)=E(Lenbit)=E(log(pi1))=i=1npilog(pi)=i=1npilog(qipi)=i=1npi(log(pi)log(qi))=E(Lenbit)=E(log(qi1))=ipilog(qi)

你可能感兴趣的:(alg)