这篇笔记,主要记录花书第三章关于概率知识和信息论知识的回顾。概率论在机器学习建模中的大量使用令人吃惊。因为机器学习,常常需要处理很多不确定的量。不确定的量可能来自模型本身的随机性、对外在失误的不完全观测以及不完全的建模。
随机变量
随机变量(random variable):随机变量是一个可以随机取不同值的一个变量,它可以是离散的,也可以是连续的。
概率分布
概率分布(probability distribution):用来描述随机变量或者一簇随机变量每一个能取到的状态的可能性大小。
概率质量函数(probability mass function PMF):离散型随机变量的概率分布。
如果一个函数P是随机变量x的PMF,必须满足如下性质:
1. P的定义域必须是x所有可能状态的集合。
2. ∀x∈x, 0<= P(x) <=1。
3. ∑xP(x)=1. 这个性质称为归一化。
联合概率分布(joint probability distribution):多个变量的概率分布。
概率密度函数(probability density function PDF):连续性随机变量的概率分布。概率密度函数p(x)并没有直接对特定的状态给出概率,而是给出落在面积为δx的无限小的区域内的概率为p(x)δx。
如果一个函数p是x的PDF,必须满足如下性质。
1. p的定义域必须是x所有可能状态的集合。
2. ∀x∈x, p(x) >= 0。(不要求p(x)<=1)
3. ∫p(x)dx=1:
边缘概率(marginal probability):定义在一组变量联合概率分布中,其中一个子集的的概率分布,称为边缘概率分布。
条件概率(conditionalprobability):某个事件在给定其他事件发生时,出现的概率。表示为:

条件概率的链式法则(The Chain Rule of Conditional Probabilities):任意多维随机变量的的联合概率分布,都可以分解成只有一个变量的条件概率相乘的形式。表示为:

独立性(Independence):如果两个随机变量x,y,如果他们的概率分布可以表示成两个因子的乘积形式,并且一个因子只包含x,另一个因子只包含y,则这两个随机变量是相互独立的。表示为:

条件独立性(conditionally independent):如果关于x和y的条件概率分布对于z的每一个值都可以写成乘积形式,那么这两个随机变量x和y在给定随机变量z时是条件独立的。表示为:

期望(expectation):f(x)关于某分布P(x)的期望是指,当x由P产生,f作用于x时,f(x)的平均值。
离散随机变量期望表示:

连续随机变量的期望表示:

方差(variance):方差是指我们根据对X进行随机采样的时候,随机变量x的值会呈现多大的差异。表示为:

协方差(covariance):协方差在某种意义上给出了两个变量的线性相关性以及他们之间的度量。表示为:

常用概率分布
贝努利分布(Bernoulli distribution):贝努利分布是一个二值随机变量分布。常见抛硬币例子。是特殊的二项分布。满足如下性质:

多项分布(Multinoulli distribution):多项分布是二项分布的一个推广,不同于抛硬币,例如掷骰子的例子。
正态分布(normal distribution):正态分布也叫高斯分布,是最常见的一种分布。例如班里学生的成绩、芝麻信用分等等,都是满足正态分布的。

多维正态分布表示如下:∑是一个正定对称矩阵,给出了分布的协方差矩阵。µ是一个向量。

指数分布(exponential distribution):在深度学习中,我们经常需要在x=0处,取得边界点的分布。可以使用指数分布。

拉普拉斯分布(Laplace distribution):允许我们在任意一处设置概率质量的峰值。

狄拉克分布(Dirac distribution):有时,我们希望概率分布中所有的质量都集中在一个点上,可以用狄拉克分布表示。

经验分布(empirical distribution):根据样本得到的分布函数。通过计算累积分布函数,收敛到概率1。狄拉克分布经常作为经验分布的一个组成部分。

混合分布(mixture distribution):通过一些简单的概率分布,通过一定的组合来定义新的概率分布,成为混合分布。
常用函数的有用性质
逻辑S型函数(logistic sigmoid function):logistic sigmoid函数很常用,通常用来产生贝努利分布的参数Φ,因为他的范围在(0,1)之间。在NG的视频教程中,判断癌症的案例也用到了这个函数。


软化加强函数(softplus function):softplus可以用来产生正态分布的β和σ参数,因为它的范围是(0,∞)。


贝叶斯法则
贝叶斯法则(Baye's Rule):在已知P(y|x),P(x)时,我们可以来计算P(x|y)的值。

这里P(y)通常可以用如下公式计算:

信息论
自信息(self-information):满足以下三个性质,我们定义一个时间的自信息为:
1. 非常可能发生的事件,需要信息量比较少;极端情况,肯定反生的事件应该是没有信息量的。
2.较不可能发生的事件,具有更高的信息量。
3.独立事件应该具有增量的信息。例如连续两次硬币正面朝上的信息量,应该是一次硬币正面朝上的信息量的两倍。

香农熵(Shannon entropy):自信息量处理单个输出,香农熵对整个概率分布中的不确定性总量进行量化。如下公式表示。

KL散度(Kullback-Leibler (KL) divergence):对于同一个随机变量x,有两个单独的概率分布P(x)和 Q(x),使用KL散度来描述这两个分布的差异。因为KL散度是非负的,如果KL散度为0.表示P和Q在离散变量上相同分布,或者连续变量上几乎处处相同。表示为:

交叉熵(cross-entropy):交叉熵主要用于度量两个概率分布间的差异性信息。表示为:

三者不得不说的关系:(https://zhuanlan.zhihu.com/p/25849615)

结构化概率模型
有向模型(Directed models):模型使用带有有向边的图,它们用条件概率分布来表示分解。

例子:

无向模型(Undirected models):模型使用带无向边的图,它们将分解表示成一组函数,这些函数通常不是任何类型的概率分布。

例子:

Q&A:
如果有兴趣相投的朋友,欢迎来http://www.jokls.com/提问或者解答其他小伙伴的提问。
网友评论