MATH ML Learning Lab
O05
O05 · 20–30 min

KKT 与 SVMKKT & SVM

不等式约束下,怎样一起检查可行性、乘子和最优候选?How can feasibility, multipliers and optimal candidates be checked together under inequality constraints?

前置知识:Prerequisites: O04:拉格朗日乘子与对偶直觉。O04: Lagrange multipliers and duality intuition.

复习前置:Review prerequisites: O04 · 拉格朗日乘子与对偶直觉Lagrange Multipliers & Duality Intuition

学完后你能:After this lesson you can: 检查四个 KKT 条件并说明必要性与充分性的条件。Check the four KKT conditions and state conditions for necessity and sufficiency.

动手观察Explore

调整变量 w 和乘子 λ,检查可行性、驻点与互补松弛;切换到边界乘子为零的例子。Adjust w and multiplier λ to check feasibility, stationarity and complementary slackness; switch to a boundary example with a zero multiplier.

从观察到解释From observation to explanation

一个可手算的约束A small solvable constraint

最小化 1/2 w²,约束 w≥1,写作 g(w)=1−w≤0。最优点 w=1,乘子 λ=1;梯度条件 w−λ=0。它与线性可分硬间隔 SVM 的间隔约束有相同的基本结构。Minimize 1/2 w² subject to w≥1, written g(w)=1−w≤0. The optimum is w=1 with multiplier λ=1 and stationarity w−λ=0. This has the basic structure of a linearly separable hard-margin SVM constraint.

互补松弛Complementary slackness

λg(w)=0 表示约束严格不活跃时乘子为零;反过来约束位于边界并不保证乘子大于零。例如最小化 (w−1)² 且 w≥1,最优边界点可取 λ=0。λg(w)=0 means a strictly inactive constraint has zero multiplier. The reverse is not guaranteed: an active boundary can have zero multiplier. For example, minimize (w−1)² subject to w≥1; the optimum has λ=0.

必要与充分Necessity and sufficiency

可微凸问题中,满足 KKT 的可行点是全局最优;要保证最优点一定满足 KKT,还需要合适的约束资格。Slater 条件是凸问题常见的充分条件。For a differentiable convex problem, a feasible KKT point is globally optimal. Ensuring an optimum satisfies KKT also requires an appropriate constraint qualification; Slater’s condition is a common sufficient condition for convex problems.

公式与符号Formula and symbols

f 是目标,g 是不等式约束,w 是变量,λ 是乘子;四项依次是原始可行、对偶可行、驻点和互补松弛。f is the objective, g an inequality constraint, w the variable and λ the multiplier. The four conditions are primal feasibility, dual feasibility, stationarity and complementary slackness.

留意这个区别Watch for this

非凸问题或缺少约束资格时,不能无条件套用必要性或充分性。不可分数据的硬间隔 SVM 可能没有可行解。Without convexity or a suitable constraint qualification, necessity and sufficiency cannot be asserted unconditionally. A hard-margin SVM can be infeasible on nonseparable data.

继续探索Explore further

继续学习算法Continue to an algorithm

支持向量机(SVM)Support vector machines (SVM)

课后练习

检验你的理解