机器学习笔记
Random Variables 随机变量
Discrete Random Variables 离散随机变量
-
Bernoulli distribution伯努利(二项)分布
X = {0, 1} pmf p(x) = Bern(x|q), where p(1) = Bern(1|q) = Pr[x = 1] = q (we also write p(x = 1)) p(0) = Bern(0|q) = Pr[x = 0] = 1 1 q (we also write p(x = 0)) -
Categorical distribution 类别分布
X = {0, 1, ..., C-1} pmf x ∼ p(x) = Cat(x|q), where probability vector q = [q0, q1, ..., qCC 1] with qk = q0 + q1 + ... + qCC 1 = 1 p(k) = Cat(k|q) = Pr[x = k] = qk (we also write p(x = k))

one-hot vector

Continuous Random Variables 连续随机变量

Gaussian variable 高斯变量

MATLAB 代码
Description of any MATLAB function: help < namefunction >
Generate a Bernoulli rv Bern(q): binornd(1, q) or (rand(1) < q)
Generate N Bernoulli rvs Bern(q): binornd(1, q, N, 1) or (rand(N, 1) < q)
Generate a categorical rv Cat(q): mnrnd(1, q)
Generate N categorical rvs Cat(q): mnrnd(1, q, N) (produces one-hot vectors as rows)
Generate a Gaussian rv N (m,s2): normrnd(m, s) or (m + s ∗ randn(1))
Gaussian pdf N (x|m,s2): normpdf(x, m, s)
Plot a function y = f (x): plot(x, y)
Expectation期望

-
Bernoulli rv 伯努利分布:

-
categorical rv 类别分布:

-
gaussion 高斯分布
Ex=x^2 +σ^2
方差Variance

-
Bernoulli RV伯努利变量
Var=q(1-q) -
Gaussian RV 高斯变量
Var(x)=σ^2 -
categorical rv 类别变量

Linear Algebra 线性代数
L * 1 vector
-
一个x向量 L * 1 vector

-
transpose of vector x 转置矩阵

-
normalize a vector 正则化矩阵(求方向)

-
measures the cosine of the angle θ between vectors x and y 两个向量的夹角


L * M matrix 矩阵
-
a L * M matrix

-
transpose matrix 转置矩阵

最低0.47元/天 解锁文章
1055

被折叠的 条评论
为什么被折叠?



