LaTeX 中的梯度符号是 \nabla,输出 ∇,不需要宏包:\nabla f 表示 f 的梯度,\nabla_\theta \mathcal{L} 表示损失函数对参数的梯度。偏导数使用 \partial,预测值是 \hat{y},期望是 \mathbb{E},argmax 写作 \operatorname*{arg\,max}。下表列出了在 LaTeX 中书写梯度时最常用的命令及各自所需的宏包;完整的机器学习符号列表见页面下方。
| 符号 | 命令 | 用途 | 宏包 | 复制 |
|---|---|---|---|---|
\nabla | 梯度符号(nabla 算子) | 内置 | ||
\nabla_\theta \mathcal{L} | 损失函数对 θ 的梯度 | 内置 | ||
\partial | 偏导数 | 内置 | ||
\frac{\partial \mathcal{L}}{\partial w} | 损失函数的偏导数 | 内置 | ||
\mathcal{L} | 损失函数 | 内置 | ||
\theta | 模型参数 | 内置 | ||
\hat{y} | 预测值、估计值 | 内置 | ||
\mathbb{E} | 期望 | amssymb | ||
\operatorname*{arg\,max}_\theta | 下方带变量的 argmax | amsmath | ||
\operatorname*{arg\,min}_\theta | 下方带变量的 argmin | amsmath | ||
\|w\|_2 | 权重的 L2 范数 | 内置 | ||
\odot | 哈达玛积(逐元素乘积) | 内置 |
\mathcal{L}\mathbb{E}\mathbb{E}[X]D_{\text{KL}}(P \| Q)\text{KL}(P \| Q)\arg\max\arg\min\arg\max_{\theta}\arg\min_{\theta}\otimes\odot\text{softmax}\sigma\text{ReLU}\nabla\nabla_{\theta} \mathcal{L}\frac{\partial \mathcal{L}}{\partial \theta}\eta\theta\theta^*\mathbf{W}\mathbf{b}H(p, q)H(X)I(X; Y)\log p(x | \theta)p(y | x)\sum_{c=1}^{C}\prod_{i=1}^{N}\| \theta \|_1\| \theta \|_2\| \mathbf{W} \|_F