熵
一種信息化的描述方法由缆,用來定義信息中不確定因素的多少。機(jī)器學(xué)習(xí)結(jié)果的好壞評判標(biāo)準(zhǔn)就是兩類信息之間的熵最小,由此引發(fā)了評判結(jié)果好壞的標(biāo)準(zhǔn)。
交叉熵
交叉熵(Cross Entropy)是Loss函數(shù)的一種(也稱為損失函數(shù)或代價函數(shù))问畅,用于描述模型預(yù)測值與真實值的差距大小,常見的Loss函數(shù)就是均方平方差(Mean Squared Error)六荒,定義如下护姆。
![][matrix]
[matrix]: http://latex.codecogs.com/png.latex?C=\frac{(y-a)^2}{2}
?平方差表示預(yù)測值與真實值直接相減,為了避免得到負(fù)數(shù)取絕對值或者平方掏击,再做平均就是均方平方差卵皂。注意這里預(yù)測值需要經(jīng)過sigmoid激活函數(shù),得到取值范圍在0到1之間的預(yù)測值砚亭。
平方差可以表達(dá)預(yù)測值與真實值的差異灯变,但在分類問題種效果并不如交叉熵好,原因可以參考這篇博文 钠惩。
交叉熵的定義如下柒凉,
當(dāng)神經(jīng)元函數(shù)為![][fact]這里
[fact]: http://latex.codecogs.com/png.latex?a=\sigma(z)
01: ![][01]
02: ![][02]
03: ![][03]
04: ![][04]
05: ![][05]
06: ![][06]
07: ![][07]
[00]: http://latex.codecogs.com/png.latex?\begin{bmatrix}1&x&x2\1&y&y2\1&z&z^2\\end{bmatrix}
[01]: http://latex.codecogs.com/png.latex?sh(x)=\frac{ex+e{-x}}{2}}
[02]: http://latex.codecogs.com/png.latex?C_n^k=\frac{n(n-1)\ldots(n-k+1)}{k!}
[03]: http://latex.codecogs.com/svg.latex?\begin{align}\sqrt{37}&=\sqrt{\frac{732-1}{122}}\&=\sqrt{\frac{732}{122}\cdot\frac{732-1}{732}}\&=\sqrt{\frac{732}{122}}\sqrt{\frac{732-1}{732}}\&=\frac{73}{12}\sqrt{1-\frac{1}{732}}\&\approx\frac{73}{12}\left(1-\frac{1}{2\cdot732}\right)\end{align}
[04]: http://latex.codecogs.com/svg.latex?\begin{array}{c|lcr}n&\text{Left}&\text{Center}&\text{Right}\\hline1&0.24&1&125\2&-1&189&-8\3&-20&2000&1+10i\\end{array}
[05]: http://latex.codecogs.com/svg.latex?\mathbb{N,Z,Q,R,C}
[06]: http://latex.codecogs.com/svg.latex?\left{\begin{array}{ll}a_1x+b_1y+c_1z&=d_1+e_1\a_2x+b_2y&=d_2\a_3x+b_3y+c_3z&=d_3\end{array}\right.
[07]: http://latex.codecogs.com/svg.latex?f\left(\left[\frac{1+\left{x,y\right}}{\left(\frac{x}{y}+\frac{y}{x}\right)\left(u+1\right)}+a\right]^{3/2}\right)