近年来,人工智能领域发展迅速。不同研究人员和研究小组之间的交流变得越来越重要。然而一个问题在于,出处不同的论文中符号使用并不统一。由此,本文对人工智能领域常用的一些数学符号提出了一般性的建议。
数据集
数据集 $S=\{ \mathbf{z}_i \}^n_{i=1}=\{(\mathbf{x}_i, \mathbf{y}_i) \}^n_{i=1}$ 从分布 $\mathcal{D}$ 中采样,定义在域 $\mathcal{Z} = \mathcal{X} \times \mathcal{Y}$ 上。
- $\mathcal{X}$ 是实例域(一个集合)
- $\mathcal{Y}$ 是标签域(一个集合)
- $\mathcal{Z}=\mathcal{X}\times\mathcal{Y}$ 是样本域(一个集合)
通常,$\mathcal{X}$ 是 $\mathbb{R}^d$ 的子集,$\mathcal{Y}$ 是 $\mathbb{R}^{d_\text{o}}$ 的子集,其中 $d$ 是输入维度,$d_\text{o}$ 是输出维度。
$n=$#$S$ 表示样本数量。在没有特别说明的情况下,$S$ 和 $n$ 表示训练集。
函数
假设空间用 $\mathcal{H}$ 表示,函数用 $f_{\mathbf{\theta}}(\mathbf{x})\in\mathcal{H}$ 或 $f(\mathbf{x};\mathbf{\theta})$ 表示,其中 $f_{\mathbf{\theta}}:\mathcal{X}\to\mathcal{Y}$。
$\mathbf{\theta}$ 表示函数 $f_{\mathbf{\theta}}$ 的参数集。
如果存在目标函数,则用 $f^*$ 或 $f^*:\mathcal{X}\to\mathcal{Y}$ 表示,同时满足 $\mathbf{y}_i=f^*(\mathbf{x}_i)$ , $i=1,\dots,n$。
损失函数
损失函数用 $\ell:\mathcal{H}\times\mathcal{Z}\to\mathbb{R}_{+}:=[0,+\infty)$ 表示,用来衡量预测值和实际值之间的差异,例如 $L^2$ 损失:
$$ \ell(f_{\mathbf{\theta}},\mathbf{z})= \frac{1}{2}(f_{\mathbf{\theta}}(\mathbf{x})-\mathbf{y})^2 $$其中 $\mathbf{z}=(\mathbf{x},\mathbf{y})$。为了方便,$\ell(f_{\mathbf{\theta}},\mathbf{z})$ 也可以写作:
$$ \ell(f_{\mathbf{\theta}}(\mathbf{x}), \mathbf{y}) $$对于样本集 $S=\{(\mathbf{x}_i,\mathbf{y}_i)\}^n_{i=1}$,训练损失用 $L_S(\mathbf{\theta})$ 或 $L_n(\mathbf{\theta})$ 或 $R_S(\mathbf{\theta})$ 或 $R_n(\mathbf{\theta})$ 表示:
$$ L_S(\mathbf{\theta})=\frac{1}{n}\sum^n_{i=1}\ell(f_{\mathbf{\theta}}(\mathbf{x}_i),\mathbf{y}_i) $$期望损失用 $L_{\mathcal{D}}$ 或 $R_{\mathcal{D}}$ 表示:
$$ L_{\mathcal{D}}(\mathbf{\theta})=\mathbb{E}_{\mathcal{D}}\ell(f_{\mathbf{\theta}}(\mathbf{x}),\mathbf{y}) $$其中 $\mathbf{z}=(\mathbf{x},\mathbf{y})$ 服从分布 $\mathcal{D}$。
激活函数
激活函数用 $\sigma(x)$ 表示。
示例,常用的激活函数有:
- $\sigma(x)=\text{ReLU}(x)=\text{max}(0,x)$
- $\sigma(x)=\text{sigmoid}(x)=\dfrac{1}{1+e^{-x}}$
- $\sigma(x)=\tanh(x)$
- $\sigma(x)=\cos x, \sin x$
双层神经网络
隐藏层的神经元数量用 $m$ 表示,双层神经网络为:
$$ f_{\mathbf{\theta}}(\mathbf{x})=\sum^m_{j=1}a_j\sigma(\mathbf{w}_j\cdot\mathbf{x}+b_j) $$其中 $\sigma$ 是激活函数,$\mathbf{w}_j$ 是输入权重,$a_j$ 是输出权重,$b_j$ 是偏置项。
表示参数集用
通用深度神经网络
计算层数时不包括输入层。一个 $L$-层神经网络表示为:
$$ f_{\mathbf{\theta}}(\mathbf{x})=\mathbf{W}^{[L-1]}\sigma\circ(\mathbf{W}^{[L-2]}\sigma\circ(\cdots(\mathbf{W}^{[1]}\sigma\circ(\mathbf{W}^{[0]}\mathbf{x}+\mathbf{b}^{[0]})+\mathbf{b}^{[1]})\cdots)+\mathbf{b}^{[L-2]})+\mathbf{b}^{[L-1]} $$其中 $\mathbf{W}^{[l]}\in\mathbb{R}^{m_{l+1}\times m_l}$,$\mathbf{b}^{[l]}=\mathbb{R}^{m_{l+1}}$,$m_0=d_\text{in}=d$,$m_{L}=d_\text{o}$,$\sigma$ 是标量函数,"$\circ$" 表示逐元素操作。表示参数集用
$$ \mathbf{\theta}=(\mathbf{W}^{[0]},\mathbf{W}^{[1]},\dots,\mathbf{W}^{[L-1]},\mathbf{b}^{[0]},\mathbf{b}^{[1]},\dots,\mathbf{b}^{[L-1]}) $$$\mathbf{W}^{[l]}$ 的某个元素用 $\mathbf{W}^{[l]}_{ij}$ 表示。这个定义也可以递归完成:
$$ f^{[0]}_{\mathbf{\theta}}(\mathbf{x})=\mathbf{x} $$$$ f^{[l]}_{\mathbf{\theta}}(\mathbf{x})=\sigma\circ(\mathbf{W}^{[l-1]}f^{[l-1]}_{\mathbf{\theta}}(\mathbf{x})+\mathbf{b}^{[l-1]}) \quad 1\le l\le L-1 $$$$ f_{\mathbf{\theta}}(\mathbf{x})=f^{[L]}_{\mathbf{\theta}}(\mathbf{x})=\mathbf{W}^{[L-1]}f^{[L-1]}_{\mathbf{\theta}}(\mathbf{x})+\mathbf{b}^{[L-1]} $$复杂度
假定类 $\mathcal{H}$ 的 VC 维度用 VCdim($\mathcal{H}$) 表示。
假定空间 $\mathcal{H}$ 在样本集 $S$ 上的 Rademacher 复杂度用 $R(\mathcal{H}\circ S)$ 或 $\text{Rad}_S(\mathcal{H})$ 表示。
复杂度 $\text{Rad}_S(\mathcal{H})$ 是随机的,因为 $S$ 是随机的。对所有大小为 $n$ 的样本的经验 Rademacher 复杂度,其期望为
$$ \text{Rad}_n(\mathcal{H}) = \mathbb{E}_S\text{Rad}_S(\mathcal{H}) $$训练
梯度下降通常用 $\text{GD}$ 表示,随机梯度下降通常用 $\text{SGD}$ 表示。
一批数据用 $B$ 表示,批量大小用 $|B|$ 表示。学习率用 $\eta$ 表示。
傅里叶频率
离散频率用 $\mathbf{k}$ 表示,连续频率用 $\mathbf{\xi}$ 表示。
卷积
卷积运算用 $*$ 表示。
符号表
符号 | 含义 | Latex | 简记 |
---|---|---|---|
$\mathbf{x}$ | 输入 | \bm{x} |
\vx |
$\mathbf{y}$ | 输出,标签 | \bm{y} |
\vy |
$d$ | 输入维度 | d |
|
$d_{\text{o}}$ | 输出维度 | d_{\rm o} |
|
$n$ | 样本量 | n |
|
$\mathcal{X}$ | 实例域(一个集合) | \mathcal{X} |
\fX |
$\mathcal{Y}$ | 标签域(一个集合) | \mathcal{Y} |
\fY |
$\mathcal{Z}$ | $=\mathcal{X}\times\mathcal{Y}$ 样本域 | \mathcal{Z} |
\fZ |
$\mathcal{H}$ | 假设空间(一个集合) | \mathcal{H} |
\fH |
$\mathbf{\theta}$ | 参数集 | \bm{\theta} |
\vtheta |
$f_{\mathbf{\theta}}: \mathcal{X}\to\mathcal{Y}$ | 假设函数 | \f_{\bm{\theta}} |
f_{\vtheta} |
$f$ or $f^*: \mathcal{X}\to\mathcal{Y}$ | 目标函数 | f, f^* |
|
$\ell:\mathcal{H}\times \mathcal{Z}\to \mathbb{R}^+$ | 损失函数 | \ell |
|
$\mathcal{D}$ | $\mathcal{Z}$ 的分布 | \mathcal{D} |
\fD |
$$S=\{\mathbf{z}_i\}_{i=1}^n$$ | $$=\{(\mathbf{x}_i,\mathbf{y}_i)\}_{i=1}^n$$ 样本集 | ||
$L_S(\mathbf{\theta})$, $L_{n}(\mathbf{\theta})$, $R_n(\mathbf{\theta})$, $R_S(\mathbf{\theta})$ | 经验误差或训练损失 | ||
$L_D(\mathbf{\theta})$ | 泛化误差或期望损失 | ||
$\sigma:\mathbb{R}\to\mathbb{R}$ | 激活函数 | \sigma |
|
$\mathbf{w}_j$ | 输入权重 | \bm{w}_j |
\vw_j |
$a_j$ | 输出权重 | a_j |
|
$b_j$ | 偏置项 | b_j |
|
$f_{\mathbf{\theta}}(\mathbf{x})$ or $f(\mathbf{x};\mathbf{\theta})$ | 神经网络 | f_{\bm{\theta}} |
f_{\vtheta} |
$\sum_{j=1}^{m} a_j \sigma (\mathbf{w}_j\cdot \mathbf{x} + b_j)$ | 双层神经网络 | ||
$\text{VCdim}(\mathcal{H}$) | $\mathcal{H}$ 的 VC 维度 | ||
$\text{Rad}(\mathcal{H}\circ S)$, $\text{Rad}_{S}(\mathcal{H})$ | $\mathcal{H}$ 在 $S$ 上的 Rademacher 复杂度 | ||
${\rm Rad}_{n} (\mathcal{H})$ | $n$ 个样本的 Rademacher 复杂度 | ||
$\text{GD}$ | 梯度下降 | ||
$\text{SGD}$ | 随机梯度下降 | ||
$B$ | 一批数据(一个集合) | B |
|
$\vert B\vert$ | 批量大小 | b |
|
$\eta$ | 学习率 | \eta |
|
$\mathbf{k}$ | 离散频率 | \bm{k} |
\vk |
$\mathbf{\xi}$ | 连续频率 | \bm{\xi} |
\vxi |
$*$ | 卷积运算 | * |
L 层神经网络
符号 | 含义 | Latex | 简记 |
---|---|---|---|
$d$ | 输入维度 | d |
|
$d_{\text{o}}$ | 输出维度 | d_{\rm o} |
|
$m_l$ | 第 $l$ 层神经元数量, $m_0=d$, $m_{L} = d_{\text{o}}$ | m_l |
|
$\mathbf{W}^{[l]}$ | 第 $l$ 层权重 | \bm{W}^{[l]} |
\mW^{[l]} |
$\mathbf{b}^{[l]}$ | 第 $l$ 层偏置项 | \bm{b}^{[l]} |
\vb^{[l]} |
$\circ$ | 逐项计算 | \circ |
|
$\sigma:\mathbb{R}\to\mathbb{R}^+$ | 激活函数 | \sigma |
|
$\mathbf{\theta}$ | $=(\mathbf{W}^{[0]},\ldots,\mathbf{W}^{[L-1]},\mathbf{b}^{[0]},\ldots,\mathbf{b}^{[L-1]})$, 参数 | \bm{\theta} |
\vtheta |
$f_{\mathbf{\theta}}^{[0]}(\mathbf{x})$ | $=\mathbf{x}$ | ||
$f_{\mathbf{\theta}}^{[l]}(\mathbf{x})$ | $=\sigma\circ(\mathbf{W}^{[l-1]} f_{\mathbf{\theta}}^{[l-1]}(\mathbf{x}) + \mathbf{b}^{[l-1]})$, 第 $l$ 层输出 | ||
$f_{\mathbf{\theta}}(\mathbf{x})$ | $=f_{\mathbf{\theta}}^{[L]}(\mathbf{x})=\mathbf{W}^{[L-1]} f_{\mathbf{\theta}}^{[L-1]}(\mathbf{x}) + \mathbf{b}^{[L-1]}$, $L$ 层神经网络 |