min
x
∥
x
−
x
0
∥
2
s
.
t
.
w
T
x
+
b
=
0
\begin{aligned} \min_{\mathbf{x}}&\quad\|\mathbf{x}-\mathbf{x}_0\|^2\\ s.t.&\quad\mathbf{w}^T\mathbf{x}+b=0 \end{aligned}
xmins.t.∥x−x0∥2wTx+b=0
其中
w
≠
0
\mathbf{w}\neq 0
w=0,
x
0
\mathbf{x}_0
x0是那个点,
x
,
x
0
,
w
∈
R
n
,
b
∈
R
\mathbf{x},\mathbf{x}_0,\mathbf{w}\in\mathbb{R}^n,b\in\mathbb{R}
x,x0,w∈Rn,b∈R
L
(
x
,
λ
)
=
∥
x
−
x
0
∥
2
+
λ
(
w
T
x
+
b
)
L\left(\mathbf{x},\lambda\right)=\|\mathbf{x}-\mathbf{x}_0\|^2+\lambda\left(\mathbf{w}^T\mathbf{x}+b\right)
L(x,λ)=∥x−x0∥2+λ(wTx+b)
∇
L
(
x
,
λ
)
=
(
2
(
x
−
x
0
)
+
λ
w
w
T
x
+
b
)
=
0
\nabla L\left(\mathbf{x},\lambda\right)=\begin{pmatrix} 2\left(\mathbf{x}-\mathbf{x}_0\right)+\lambda\mathbf{w}\\ \mathbf{w}^T\mathbf{x}+b \end{pmatrix}=0
∇L(x,λ)=(2(x−x0)+λwwTx+b)=0
x
=
x
0
−
λ
w
2
w
T
x
0
−
λ
∥
w
∥
2
2
+
b
=
0
\mathbf{x}=\mathbf{x}_0-\frac{\lambda \mathbf{w}}{2}\\ \mathbf{w}^T\mathbf{x}_0-\frac{\lambda \|\mathbf{w}\|^2}{2}+b=0
x=x0−2λwwTx0−2λ∥w∥2+b=0
∥
x
−
x
0
∥
2
=
λ
2
∥
w
∥
2
4
=
(
w
T
x
0
+
b
)
2
∥
w
∥
2
⇒
d
=
∣
w
T
x
0
+
b
∣
∥
w
∥
\quad\|\mathbf{x}-\mathbf{x}_0\|^2=\frac{\lambda^2\|\mathbf{w}\|^2}{4}=\frac{\left(\mathbf{w}^T\mathbf{x}_0+b\right)^2}{\|\mathbf{w}\|^2}\Rightarrow \mathbf{d}=\frac{\left|\mathbf{w}^T\mathbf{x}_0+b\right|}{\|\mathbf{w}\|}
∥x−x0∥2=4λ2∥w∥2=∥w∥2(wTx0+b)2⇒d=∥w∥∣∣wTx0+b∣∣