
導讀:作為機器學習從業者,你需要知道機率分佈相關的知識。這裡有一份最常見的基本機率分佈教程,大多數和使用 Python 庫進行深度學習有關。

-
共軛意味著它有共軛分佈的關係。 在貝葉斯機率論中,如果後驗分佈 p(θx)與先驗機率分佈 p(θ)在同一機率分佈族中,則先驗和後驗稱為共軛分佈,先驗稱為似然函式的共軛先驗。共軛先驗維基百科在這裡 https://en.wikipedia.org/wiki/Conjugate_prior -
多分類表示隨機方差大於 2。
-
n 次意味著我們也考慮了先驗機率 p(x)。
-
為了進一步瞭解機率,我建議閱讀 [pattern recognition and machine learning,Bishop 2006]。
-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/uniform.py

-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/bernoulli.py
-
先驗機率 p(x)不考慮伯努利分佈。因此,如果我們對最大似然進行最佳化,那麼我們很容易被過度擬合。
-
利用二元交叉熵對二項分類進行分類。它的形式與伯努利分佈的負對數相同。

-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/binomial.py
-
引數為 n 和 p 的二項分佈是一系列 n 個獨立實驗中成功次數的離散機率分佈。
-
二項式分佈是指透過指定要提前挑選的數量而考慮先驗機率的分佈。

-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/categorical.py
-
多伯努利稱為分類分佈。
-
交叉熵和採取負對數的多伯努利分佈具有相同的形式。

-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/multinomial.py

-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/beta.py
-
β分佈與二項分佈和伯努利分佈共軛。
-
利用共軛,利用已知的先驗分佈可以更容易地得到後驗分佈。
-
當β分佈滿足特殊情況(α=1,β=1)時,均勻分佈是相同的。

-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/dirichlet.py
-
dirichlet 分佈與多項式分佈是共軛的。
-
如果 k=2,則為β分佈。

-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/gamma.py
-
如果 gamma(a,1)/gamma(a,1)+gamma(b,1)與 beta(a,b)相同,則 gamma 分佈為β分佈。
-
指數分佈和卡方分佈是伽馬分佈的特例。

-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/exponential.py

-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/gaussian.py
高斯分佈是一種非常常見的連續機率分佈。

-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/normal.py
正態分佈為標準高斯分佈,平均值為 0,標準差為 1。

-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/chi-squared.py
-
k 自由度的卡方分佈是 k 個獨立標準正態隨機變數的平方和的分佈。
-
卡方分佈是 β 分佈的特例

-
程式碼: https://github.com/graykode/distribution-is-all-you-need/blob/master/student-t.py


延伸閱讀👇

延伸閱讀《神經網路與深度學習》