点到平面距离距离公式

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.xx02wTx+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,wRn,bR

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,λ)=xx02+λ(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(xx0)+λ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=x02λwwTx02λw2+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}\|} xx02=4λ2w2=w2(wTx0+b)2d=wwTx0+b

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Nightmare004

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值