Wikipedia Optimization and Regularization Concepts (维基百科优化与正则化概念)¶
来源: Wikipedia (英文维基百科)
编译时间: 2026-06-01
状态: 中英对照编译
基于: Mathematical optimization, Regularization, Gradient descent 等条目
关联: 统计学概念, 深度学习概念
📚 目录 (Table of Contents)¶
1. 数学优化基础 (Mathematical Optimization Basics)¶
1.1 优化问题定义 (Optimization Problem Definition)¶
英文:
Mathematical optimization is the selection of a best element (with regard to some criterion) from some set of available alternatives. An optimization problem consists of minimizing or maximizing a real function by systematically choosing input values from within an allowed set.
中文:
数学优化是从一些可用备选方案中选择最佳元素 (关于某个标准)。优化问题包括通过从允许集合中系统地选择输入值来最小化或最大化实函数。
标准形式 (Standard Form):
其中: - \(f(x)\): 目标函数 (objective function) - \(g_i(x)\): 不等式约束 (inequality constraints) - \(h_j(x)\): 等式约束 (equality constraints) - \(x\): 优化变量 (optimization variables)
1.2 优化问题分类 (Classification of Optimization Problems)¶
| 分类标准 | 类型 | 英文 | 特点 |
|---|---|---|---|
| 目标函数 | 线性规划 | Linear Programming | 线性的目标和约束 |
| 目标函数 | 二次规划 | Quadratic Programming | 二次目标,线性约束 |
| 目标函数 | 非线性规划 | Nonlinear Programming | 非线性目标或约束 |
| 变量类型 | 连续优化 | Continuous Optimization | 连续变量 |
| 变量类型 | 离散优化 | Discrete Optimization | 整数/离散变量 |
| 变量类型 | 组合优化 | Combinatorial Optimization | 有限离散集合 |
| 约束 | 无约束优化 | Unconstrained Optimization | 无约束 |
| 约束 | 约束优化 | Constrained Optimization | 有约束 |
| 确定性 | 确定性优化 | Deterministic Optimization | 确定性参数 |
| 确定性 | 随机优化 | Stochastic Optimization | 随机参数 |
1.3 最优性条件 (Optimality Conditions)¶
英文:
Optimality conditions characterize local and global minima/maxima of optimization problems.
中文:
最优性条件刻画优化问题的局部和全局最小值/最大值。
一阶必要条件 (First-Order Necessary Condition):
对于无约束优化问题 \(\min_x f(x)\),如果 \(x^*\) 是局部最小值且 \(f\) 可微,则:
这样的点称为驻点 (stationary point)。
二阶充分条件 (Second-Order Sufficient Condition):
如果 \(\nabla f(x^*) = 0\) 且 \(\nabla^2 f(x^*) \succ 0\) (正定),则 \(x^*\) 是严格局部最小值。
KKT 条件 (KKT Conditions):
对于约束优化问题,Karush-Kuhn-Tucker 条件是最优解的必要条件:
2. 优化算法 (Optimization Algorithms)¶
2.1 梯度下降法 (Gradient Descent)¶
英文:
Gradient descent is a first-order iterative optimization algorithm for finding a local minimum of a differentiable function.
中文:
梯度下降是一阶迭代优化算法,用于寻找可微函数的局部最小值。
梯度下降更新规则 (Gradient Descent Update Rule):
其中 \(\alpha > 0\) 是学习率 (步长)。
梯度下降变体 (Gradient Descent Variants):
| 变体 | 英文 | 更新规则 | 特点 |
|---|---|---|---|
| 批量梯度下降 | Batch GD | \(x_{k+1} = x_k - \alpha \sum_{i=1}^{n} \nabla f_i(x_k)\) | 精确但慢 |
| 随机梯度下降 | SGD | \(x_{k+1} = x_k - \alpha \nabla f_i(x_k)\) | 快速但有噪声 |
| 小批量梯度下降 | Mini-batch GD | \(x_{k+1} = x_k - \alpha \sum_{i \in B} \nabla f_i(x_k)\) | 平衡两者 |
Python 实现 (Python Implementation):
import numpy as np
def gradient_descent(f, grad_f, x0, learning_rate=0.01, max_iter=1000, tol=1e-6):
"""
梯度下降法
参数:
f: 目标函数
grad_f: 梯度函数
x0: 初始点
learning_rate: 学习率 α
max_iter: 最大迭代次数
tol: 收敛容差
返回:
x: 最优解
history: 迭代历史
"""
x = x0
history = [f(x)]
for i in range(max_iter):
grad = grad_f(x)
# 检查收敛
if np.linalg.norm(grad) < tol:
break
# 更新
x = x - learning_rate * grad
history.append(f(x))
return x, history
# 使用示例
# f = lambda x: x[0]**2 + x[1]**2
# grad_f = lambda x: np.array([2*x[0], 2*x[1]])
# x_opt, hist = gradient_descent(f, grad_f, x0=np.array([1.0, 1.0]))
2.2 牛顿法 (Newton's Method)¶
英文:
Newton's method is a second-order optimization algorithm that uses the Hessian matrix to find the minimum of a function.
中文:
牛顿法是二阶优化算法,使用海森矩阵来寻找函数的最小值。
牛顿法更新规则 (Newton's Method Update Rule):
其中 \(\nabla^2 f(x_k)\) 是海森矩阵 (Hessian matrix)。
拟牛顿法 (Quasi-Newton Methods):
| 方法 | 英文 | 特点 |
|---|---|---|
| DFP | Davidon-Fletcher-Powell | 第一个拟牛顿法 |
| BFGS | Broyden-Fletcher-Goldfarb-Shanno | 最常用的拟牛顿法 |
| L-BFGS | Limited-memory BFGS | 适合大规模问题 |
2.3 共轭梯度法 (Conjugate Gradient Method)¶
英文:
The conjugate gradient method is an iterative method for solving systems of linear equations and optimization problems, particularly effective for large sparse systems.
中文:
共轭梯度法是求解线性方程组和优化问题的迭代方法,对大规模稀疏系统特别有效。
CG 算法 (CG Algorithm):
初始化:
x₀, r₀ = b - Ax₀, p₀ = r₀
For k = 0, 1, 2, ...:
αₖ = (rₖᵀ rₖ) / (pₖᵀ A pₖ)
xₖ₊₁ = xₖ + αₖ pₖ
rₖ₊₁ = rₖ - αₖ A pₖ
βₖ = (rₖ₊₁ᵀ rₖ₊₁) / (rₖᵀ rₖ)
pₖ₊₁ = rₖ₊₁ + βₖ pₖ
2.4 Adam 优化器 (Adam Optimizer)¶
英文:
Adam (Adaptive Moment Estimation) is an optimization algorithm that combines the advantages of AdaGrad and RMSProp, using adaptive learning rates for each parameter.
中文:
Adam (自适应矩估计) 是一种优化算法,结合了 AdaGrad 和 RMSProp 的优点,为每个参数使用自适应学习率。
Adam 更新规则 (Adam Update Rule):
# 初始化
m₀ = 0 # 一阶矩
v₀ = 0 # 二阶矩
# For each iteration t:
m_t = β₁ * m_{t-1} + (1 - β₁) * g_t
v_t = β₂ * v_{t-1} + (1 - β₂) * g_t²
# 偏差校正
m̂_t = m_t / (1 - β₁^t)
v̂_t = v_t / (1 - β₂^t)
# 更新
θ_t = θ_{t-1} - α * m̂_t / (√v̂_t + ε)
典型参数: - \(\alpha = 0.001\) (学习率) - \(\beta_1 = 0.9\) (一阶矩衰减) - \(\beta_2 = 0.999\) (二阶矩衰减) - \(\epsilon = 10^{-8}\) (数值稳定性)
3. 正则化方法 (Regularization Methods)¶
3.1 正则化基础 (Regularization Basics)¶
英文:
Regularization is a technique used to prevent overfitting by adding a penalty term to the loss function, discouraging overly complex models.
中文:
正则化是一种通过向损失函数添加惩罚项来防止过拟合的技术,阻止过于复杂的模型。
正则化目标函数 (Regularized Objective):
其中: - \(\mathcal{L}(\theta)\): 原始损失函数 - \(R(\theta)\): 正则化项 - \(\lambda > 0\): 正则化强度
3.2 L1 正则化 (L1 Regularization)¶
英文:
L1 regularization adds the sum of absolute values of parameters as the penalty term, leading to sparse solutions.
中文:
L1 正则化将参数的绝对值之和作为惩罚项,导致稀疏解。
L1 正则化公式 (L1 Regularization Formula):
特性 (Properties): - ✅ 产生稀疏解 (特征选择) - ✅ 对异常值鲁棒 - ❌ 不可微 (在 0 点) - ❌ 可能不稳定 (高相关特征)
3.3 L2 正则化 (L2 Regularization)¶
英文:
L2 regularization adds the sum of squared values of parameters as the penalty term, shrinking coefficients towards zero.
中文:
L2 正则化将参数的平方和作为惩罚项,将系数收缩向零。
L2 正则化公式 (L2 Regularization Formula):
特性 (Properties): - ✅ 平滑收缩 - ✅ 处理多重共线性 - ✅ 解析解可用 - ❌ 不产生稀疏解
3.4 Elastic Net¶
英文:
Elastic Net combines L1 and L2 regularization, balancing sparsity and stability.
中文:
Elastic Net 结合 L1 和 L2 正则化,平衡稀疏性和稳定性。
Elastic Net 公式 (Elastic Net Formula):
其中 \(\alpha \in [0, 1]\) 控制 L1 和 L2 的比例。
3.5 Dropout¶
英文:
Dropout is a regularization technique for neural networks where randomly selected neurons are ignored during training, preventing co-adaptation.
中文:
Dropout 是神经网络的正则化技术,训练期间随机忽略选定的神经元,防止协同适应。
Dropout 机制 (Dropout Mechanism):
训练时:
输入层: [●] [●] [●] [●] [●]
│ │ │ │ │
隐藏层 1: [●] [○] [●] [○] [●] ← 随机丢弃 (○)
│ │ │
隐藏层 2: [●] [●] [○] [●] ← 随机丢弃
│ │ │ │
输出层: [●] [●] [●]
测试时:
所有神经元激活,权重乘以保留概率 p
Python 实现 (Python Implementation):
import numpy as np
class Dropout:
def __init__(self, p=0.5):
"""
Dropout 层
参数:
p: 保留概率 (默认 0.5)
"""
self.p = p
self.mask = None
def forward(self, x, training=True):
if training:
# 生成 mask
self.mask = (np.random.rand(*x.shape) < self.p) / self.p
return x * self.mask
else:
return x
def backward(self, dout):
return dout * self.mask
# 使用示例
# dropout = Dropout(p=0.5)
# x_train = dropout.forward(x, training=True)
# x_test = dropout.forward(x, training=False)
3.6 早停法 (Early Stopping)¶
英文:
Early stopping is a form of regularization where training is stopped when the validation error starts to increase, preventing overfitting.
中文:
早停法是一种正则化形式,当验证误差开始增加时停止训练,防止过拟合。
早停策略 (Early Stopping Strategy):
误差
↑
│
│ 验证误差
│ ╱ ← 早停点
│ ╱│
│ ╱ │
│ ╱ │
│ ╱ │
│ ╱ │
│ ╱ │
│ ╱ │
│ ╱ │
│ ╱ │
│──────────────────│─────→ 训练轮数
│ │
│ 训练误差 ────────│
│
4. 凸优化 (Convex Optimization)¶
4.1 凸集与凸函数 (Convex Sets and Functions)¶
英文:
A set is convex if the line segment between any two points in the set lies entirely within the set. A function is convex if its epigraph is a convex set.
中文:
如果集合中任意两点之间的线段完全包含在集合内,则该集合是凸的。如果函数的上图是凸集,则该函数是凸的。
凸集定义 (Convex Set Definition):
集合 \(C\) 是凸的,如果对于所有 \(x_1, x_2 \in C\) 和 \(\theta \in [0, 1]\):
凸函数定义 (Convex Function Definition):
函数 \(f: \mathbb{R}^n \to \mathbb{R}\) 是凸的,如果其定义域是凸集,且对于所有 \(x_1, x_2\) 和 \(\theta \in [0, 1]\):
4.2 凸优化问题性质 (Properties of Convex Optimization Problems)¶
| 性质 | 英文 | 中文 | 含义 |
|---|---|---|---|
| 局部最优即全局最优 | Local optimum is global | 局部最小值=全局最小值 | |
| 唯一性 | Uniqueness | 严格凸时有唯一解 | |
| KKT 充分性 | KKT sufficiency | KKT 条件也是充分的 | |
| 对偶性 | Duality | 强对偶性成立 |
4.3 对偶问题 (Dual Problem)¶
英文:
The dual problem is derived from the primal optimization problem using Lagrange multipliers, providing a lower bound on the optimal value.
中文:
对偶问题是使用拉格朗日乘子从原始优化问题导出的,提供最优值的下界。
拉格朗日函数 (Lagrangian Function):
对偶函数 (Dual Function):
对偶问题 (Dual Problem):
5. 约束优化 (Constrained Optimization)¶
5.1 拉格朗日乘子法 (Lagrange Multipliers)¶
英文:
The method of Lagrange multipliers finds the local maxima and minima of a function subject to equality constraints.
中文:
拉格朗日乘子法寻找函数在等式约束下的局部最大值和最小值。
等式约束问题 (Equality Constrained Problem):
拉格朗日函数 (Lagrangian):
最优性条件 (Optimality Conditions):
5.2 罚函数法 (Penalty Methods)¶
英文:
Penalty methods convert a constrained optimization problem into a sequence of unconstrained problems by adding a penalty for constraint violations.
中文:
罚函数法通过为违反约束添加惩罚,将约束优化问题转换为一系列无约束问题。
罚函数 (Penalty Function):
其中 \(\rho > 0\) 是罚参数,逐渐增大。
5.3 增广拉格朗日法 (Augmented Lagrangian Method)¶
英文:
The augmented Lagrangian method combines Lagrange multipliers with a penalty term, providing better convergence than pure penalty methods.
中文:
增广拉格朗日法结合拉格朗日乘子和惩罚项,提供比纯罚函数法更好的收敛性。
增广拉格朗日函数 (Augmented Lagrangian):
6. 随机优化 (Stochastic Optimization)¶
6.1 随机规划 (Stochastic Programming)¶
英文:
Stochastic programming deals with optimization problems where some of the data is uncertain and modeled as random variables.
中文:
随机规划处理某些数据不确定并建模为随机变量的优化问题。
两阶段随机规划 (Two-Stage Stochastic Programming):
目标函数 (Objective Function):
其中 \(Q(x, \xi)\) 是第二阶段的最优值。
6.2 鲁棒优化 (Robust Optimization)¶
英文:
Robust optimization seeks solutions that are immunized against uncertainty by optimizing for the worst-case scenario within an uncertainty set.
中文:
鲁棒优化通过在不确定性集合内优化最坏情况,寻求对不确定性免疫的解。
鲁棒优化问题 (Robust Optimization Problem):
其中 \(\mathcal{U}\) 是不确定性集合。
6.3 模拟退火 (Simulated Annealing)¶
英文:
Simulated annealing is a probabilistic technique for approximating the global optimum of a given function, inspired by the annealing process in metallurgy.
中文:
模拟退火是一种概率技术,用于近似给定函数的全局最优解,灵感来自冶金中的退火过程。
模拟退火算法 (Simulated Annealing Algorithm):
初始化: 初始解 x₀, 初始温度 T₀
For k = 0, 1, 2, ...:
1. 从邻域生成新解 x'
2. 计算 ΔE = f(x') - f(xₖ)
3. 如果 ΔE < 0:
接受 x' (xₖ₊₁ = x')
否则:
以概率 exp(-ΔE/Tₖ) 接受 x'
4. 降低温度: Tₖ₊₁ = α × Tₖ
返回最佳找到的解
🔑 关键术语对照表 (Glossary)¶
| English | 中文 | 定义 |
|---|---|---|
| Mathematical optimization | 数学优化 | 从备选方案中选择最佳元素 |
| Gradient descent | 梯度下降 | 一阶迭代优化算法 |
| Newton's method | 牛顿法 | 二阶优化算法 (使用海森矩阵) |
| Conjugate gradient | 共轭梯度 | 迭代求解线性系统的方法 |
| Adam optimizer | Adam 优化器 | 自适应矩估计优化算法 |
| Regularization | 正则化 | 防止过拟合的技术 |
| L1 regularization | L1 正则化 | 绝对值惩罚 (稀疏解) |
| L2 regularization | L2 正则化 | 平方惩罚 (收缩系数) |
| Dropout | Dropout | 神经网络正则化技术 |
| Early stopping | 早停法 | 验证误差增加时停止训练 |
| Convex optimization | 凸优化 | 凸目标函数和凸可行集 |
| Lagrange multipliers | 拉格朗日乘子 | 处理约束的方法 |
| Dual problem | 对偶问题 | 从原始问题导出的最大化问题 |
| Stochastic optimization | 随机优化 | 处理不确定性的优化 |
| Robust optimization | 鲁棒优化 | 最坏情况优化 |
| Simulated annealing | 模拟退火 | 全局优化概率算法 |
编译完成时间: 2026-06-01
来源: Wikipedia Mathematical optimization, Regularization, Gradient descent 等条目
关联文档: deep-learning-concepts-zh-en.md