优化问题-Lagrange函数和共轭函数


利用对偶函数可以从对偶函数最大化的角度来分析原始问题的最小化,这类似于信号分析中,通过信号的频域特性来分析其时域特性。相当于对优化问题另一个维度的解释, 对偶在理解和求解优化问题中起着关键的作用

Lagrange对偶函数

标准优化问题(不一定为凸)形式:
p ⋆ = min ⁡ f 0 ( x )  s.t.  f i ( x ) ⩽ 0 , i = 1 , … , m h i ( x ) = 0 , i = 1 , … , p \begin{aligned} p^{\star}=\min & \quad f_0(\mathbf{x}) \\ \text { s.t. } & \quad f_i(\mathbf{x}) \leqslant 0, i=1, \ldots, m \\ & \quad h_i(\mathbf{x})=0, i=1, \ldots, p \end{aligned} p=min s.t. f0(x)fi(x)0,i=1,,mhi(x)=0,i=1,,p
其中,定义域为: D = ( ⋂ i = 0 m dom ⁡ f i ) ∩ ( ⋂ i = 1 p dom ⁡ h i ) \mathcal{D}=\left(\bigcap_{i=0}^m \operatorname{dom} f_i\right) \cap\left(\bigcap_{i=1}^p \operatorname{dom} h_i\right) D=(i=0mdomfi)(i=1pdomhi)

该问题称为原问题,未知变量称作原始变量

Lagrange函数的定义为:
L ( x , λ , ν ) = f 0 ( x ) + ∑ i = 1 m λ i f i ( x ) + ∑ i = 1 p ν i h i ( x ) \mathcal{L}(\mathbf{x}, \boldsymbol{\lambda}, \boldsymbol{\nu})=f_0(\mathbf{x})+\sum_{i=1}^m \lambda_i f_i(\mathbf{x})+\sum_{i=1}^p \nu_i h_i(\mathbf{x}) L(x,λ,ν)=f0(x)+i=1mλifi(x)+i=1pνihi(x)
其定义域为 dom ⁡ L = D × R m × R p \operatorname{dom} \mathcal{L}=\mathcal{D} \times \mathbb{R}^m \times \mathbb{R}^p domL=D×Rm×Rp λ = [ λ 1 , … , λ m ] T \boldsymbol{\lambda}=\left[\lambda_1, \ldots, \lambda_m\right]^{\mathrm{T}} λ=[λ1,,λm]T ν = [ ν 1 , … , ν p ] T \boldsymbol{\nu}=\left[\nu_1, \ldots, \nu_p\right]^{\mathrm{T}} ν=[ν1,,νp]T称作对偶变量或者Lagrange乘子

Lagrange对偶函数(或对偶函数)定义为:
g ( λ , ν ) ≜ inf ⁡ x ∈ D L ( x , λ , ν ) g(\boldsymbol{\lambda}, \boldsymbol{\nu}) \triangleq \inf _{\mathbf{x} \in \mathcal{D}} \mathcal{L}(\mathbf{x}, \boldsymbol{\lambda}, \boldsymbol{\nu}) g(λ,ν)xDinfL(x,λ,ν)

:不难发现Lagrange函数时凹函数。因为对偶函数是关于 ( λ , ν ) (\boldsymbol{\lambda}, \boldsymbol{\nu}) (λ,ν)的放射函数(凹函数)的逐点下确界,因此为凹。(利用上镜图epigraph可以证明。)

其定义域为: dom ⁡ g = { ( λ , ν ) ∣ g ( λ , ν ) > − ∞ } \operatorname{dom} g=\{(\boldsymbol{\lambda}, \boldsymbol{\nu}) \mid g(\boldsymbol{\lambda}, \boldsymbol{\nu})>-\infty\} domg={(λ,ν)g(λ,ν)>}

  • 对偶函数和原始问题的关系:
    对于任意的 λ ⪰ 0 \boldsymbol{\lambda} \succeq \mathbf{0} λ0 ν ∈ R p \boldsymbol{\nu} \in \mathbb{R}^p νRp,有:

g ( λ , ν ) ⩽ p ⋆ g(\boldsymbol{\lambda}, \boldsymbol{\nu}) \leqslant p^{\star} g(λ,ν)p

证明:假设 x ~ \tilde{\mathbf{x}} x~是原问题的一个可行解,择优:

L ( x ~ , λ , ν ) = f 0 ( x ~ ) + ∑ i = 1 m λ i f i ( x ~ ) + ∑ i = 1 p ν i h i ( x ~ ) ⩽ f 0 ( x ~ ) \mathcal{L}(\tilde{\mathbf{x}}, \boldsymbol{\lambda}, \nu)=f_0(\tilde{\mathbf{x}})+\sum_{i=1}^m \lambda_i f_i(\tilde{\mathbf{x}})+\sum_{i=1}^p \nu_i h_i(\tilde{\mathbf{x}}) \leqslant f_0(\tilde{\mathbf{x}}) L(x~,λ,ν)=f0(x~)+i=1mλifi(x~)+i=1pνihi(x~)f0(x~)
由此可得:
p ⋆ ⩾ f 0 ( x ~ ) ⩾ L ( x ~ , λ , ν ) ⩾ inf ⁡ x ∈ D L ( x , λ , ν ) = g ( λ , ν ) p^{\star} \geqslant f_0(\tilde{\mathbf{x}}) \geqslant \mathcal{L}(\tilde{\mathbf{x}}, \boldsymbol{\lambda}, \boldsymbol{\nu}) \geqslant \inf _{\mathbf{x} \in \mathcal{D}} \mathcal{L}(\mathbf{x}, \boldsymbol{\lambda}, \boldsymbol{\nu})=g(\boldsymbol{\lambda}, \boldsymbol{\nu}) pf0(x~)L(x~,λ,ν)xDinfL(x,λ,ν)=g(λ,ν)

共轭函数

函数 f : R n → R f: \mathbb{R}^n \rightarrow \mathbb{R} f:RnR的共轭函数记作 f ∗ : R n → R f^*: \mathbb{R}^n \rightarrow \mathbb{R} f:RnR,定义为:

f ∗ ( y ) = sup ⁡ x ∈ dom ⁡ f ( y T x − f ( x ) ) f^*(\mathbf{y})=\sup _{\mathbf{x} \in \operatorname{dom} f}\left(\mathbf{y}^{\mathrm{T}} \mathbf{x}-f(\mathbf{x})\right) f(y)=xdomfsup(yTxf(x))

其定义域为: dom ⁡ f ∗ = { y ∣ f ∗ ( y ) < ∞ } \operatorname{dom} f^*=\left\{\mathbf{y} \mid f^*(\mathbf{y})<\infty\right\} domf={yf(y)<}

  • 不难看出,无论 f ( x ) f(\mathbf{x}) f(x)的凹凸性, f ∗ ( y ) f^*(\mathbf{y}) f(y)是一个凸函数(仿射函数的驻点最大化是凸函数)。

关于共轭函数一些重要的性质:

  • 如果 f ( x ) f(\mathbf{x}) f(x)是可微的,则 y = ∇ x f ( x ∗ ) ∈ dom ⁡ f ∗ \mathbf{y}=\nabla_{\mathbf{x}} f\left(\mathbf{x}^*\right) \in \operatorname{dom} f^* y=xf(x)domf是获得 f ∗ ( y ) f^*(\mathbf{y}) f(y)的必要条件。(因为共轭函数的最优值必然满足 ∇ x ( y T x − f ( x ) ) = 0 \nabla_{\mathbf{x}}\left(\mathbf{y}^{\mathrm{T}} \mathbf{x}-f(\mathbf{x})\right)=\mathbf{0} x(yTxf(x))=0)。
  • 如果 f ( x ) f(\mathbf{x}) f(x)是可微且凸的,则 y = ∇ x f ( x ⋆ ) \mathbf{y}=\nabla_{\mathbf{x}} f\left(\mathbf{x}^{\star}\right) y=xf(x)变为了充分条件,此时有: f ∗ ( y ) = ( x ⋆ ) T ∇ x f ( x ⋆ ) − f ( x ⋆ ) f^*(\mathbf{y})=\left(\mathbf{x}^{\star}\right)^{\mathrm{T}} \nabla_{\mathbf{x}} f\left(\mathbf{x}^{\star}\right)-f\left(\mathbf{x}^{\star}\right) f(y)=(x)Txf(x)f(x),其中 x ⋆ \mathrm{x}^{\star} x y = ∇ x f ( x ⋆ ) \mathbf{y}=\nabla_{\mathbf{x}} f\left(\mathbf{x}^{\star}\right) y=xf(x)得到。(成立的原因是,共轭函数的二阶导恰好半正定,因此一阶条件满足的点必是其最优解)。

下面给出一些简单的凸函数的共轭函数:

  • 仿射函数: f ( x ) = a x + b ↔ f ∗ ( y ) = − b , y ∈ { a } f(x)=a x+b \leftrightarrow f^*(y)=-b, y \in\{a\} f(x)=ax+bf(y)=b,y{a}
  • 负对数函数: f ( x ) = − log ⁡ x ↔ f ∗ ( y ) = − 1 − log ⁡ ( − y ) f(x)=-\log x \leftrightarrow f^*(y)=-1-\log (-y) f(x)=logxf(y)=1log(y)
  • 负熵函数: f ( x ) = x log ⁡ x ↔ f ∗ ( y ) = y e y − 1 − e y − 1 ( y − 1 ) = e y − 1 f(x)=x \log x \leftrightarrow f^*(y)=y \mathrm{e}^{y-1}-\mathrm{e}^{y-1}(y-1)=\mathrm{e}^{y-1} f(x)=xlogxf(y)=yey1ey1(y1)=ey1
  • 严格图二次函数: f ( x ) = 1 2 x T Q x ↔ f ∗ ( y ) = 1 2 y T Q − 1 y f(\mathbf{x})=\frac{1}{2} \mathbf{x}^{\mathrm{T}} \mathbf{Q} \mathbf{x} \leftrightarrow f^*(\mathbf{y})=\frac{1}{2} \mathbf{y}^{\mathrm{T}} \mathbf{Q}^{-1} \mathbf{y} f(x)=21xTQxf(y)=21yTQ1y

一些重要的推论

  • 如果 f f f是闭凸函数,则有 f ∗ ∗ = f f^{* *}=f f=f

其证明也很容易,假定 f f f是可微的,令 y = ∇ f ( x 0 ) ∈ dom ⁡ f ∗ \mathbf{y}=\nabla f\left(\mathbf{x}_0\right) \in \operatorname{dom} f^* y=f(x0)domf,则 f ∗ ( y ) f^*(\mathbf{y}) f(y)的共轭为:
f ∗ ∗ ( x ) = sup ⁡ y ∈ dom ⁡ f ∗ { x T y − f ∗ ( y ) } = sup ⁡ x 0 ∈ dom ⁡ f { x T ∇ f ( x 0 ) − ∇ f ( x 0 ) T x 0 + f ( x 0 ) } = sup ⁡ x 0 ∈ dom ⁡ { f ( x 0 ) + ∇ f ( x 0 ) T ( x − x 0 ) } = f ( x ) \begin{aligned} f^{* *}(\mathbf{x}) &=\sup _{\mathbf{y} \in \operatorname{dom} f^*}\left\{\mathbf{x}^{\mathrm{T}} \mathbf{y}-f^*(\mathbf{y})\right\} \\ &=\sup _{\mathbf{x}_0 \in \operatorname{dom} f}\left\{\mathbf{x}^{\mathrm{T}} \nabla f\left(\mathbf{x}_0\right)-\nabla f\left(\mathbf{x}_0\right)^{\mathrm{T}} \mathbf{x}_0+f\left(\mathbf{x}_0\right)\right\} \\ &=\sup _{\mathbf{x}_0 \in \operatorname{dom}}\left\{f\left(\mathbf{x}_0\right)+\nabla f\left(\mathbf{x}_0\right)^{\mathrm{T}}\left(\mathbf{x}-\mathbf{x}_0\right)\right\}\\&=f(\mathbf{x}) \end{aligned} f(x)=ydomfsup{xTyf(y)}=x0domfsup{xTf(x0)f(x0)Tx0+f(x0)}=x0domsup{f(x0)+f(x0)T(xx0)}=f(x)

  • 即时 f f f是非凸的,其共轭依然是凸函数,并且此时有 f ∗ ∗ = g f ∗ ∗ = g f f^{* *}=g_f^{* *}=g_f f=gf=gf g f g_f gf是函数可微非凸函数 f f f的凸包络)

Lagrange对偶函数和共轭函数的关系

考虑如下仿射约束的优化问题:
min ⁡ f 0 ( x )  s.t.  x = 0 \begin{aligned} &\min f_0(\mathbf{x}) \\ &\text { s.t. } \mathbf{x}=\mathbf{0} \end{aligned} minf0(x) s.t. x=0
其Lagrange函数为: L ( x , ν ) = f 0 ( x ) + ν T x \mathcal{L}(\mathbf{x}, \boldsymbol{\nu})=f_0(\mathbf{x})+\boldsymbol{\nu}^{\mathrm{T}} \mathbf{x} L(x,ν)=f0(x)+νTx,其对应的对偶函数为:
g ( ν ) = inf ⁡ x { f 0 ( x ) + ν T x } = − sup ⁡ x { ( − ν ) T x − f 0 ( x ) } = − f 0 ∗ ( − ν ) \begin{aligned} g(\boldsymbol{\nu}) &=\inf _{\mathbf{x}}\left\{f_0(\mathbf{x})+\boldsymbol{\nu}^{\mathrm{T}} \mathbf{x}\right\} \\ &=-\sup _{\mathbf{x}}\left\{(-\boldsymbol{\nu})^{\mathrm{T}} \mathbf{x}-f_0(\mathbf{x})\right\}=-f_0^*(-\boldsymbol{\nu}) \end{aligned} g(ν)=xinf{f0(x)+νTx}=xsup{(ν)Txf0(x)}=f0(ν)
其中, dom ⁡ g = − dom ⁡ f 0 ∗ \operatorname{dom} g=-\operatorname{dom} f_0^* domg=domf0。由于 f 0 ∗ f_0^* f0是凸的,所以 g ( ν ) g(\boldsymbol{\nu}) g(ν)是凹的。

考虑更一般的优化问题形式:
min ⁡ f 0 ( x )  s.t.  A x ⪯ b , C x = d \begin{array}{ll} \min & f_0(\mathbf{x}) \\ \text { s.t. } & \mathbf{A x} \preceq \mathbf{b}, \mathbf{C x}=\mathbf{d} \end{array} min s.t. f0(x)Axb,Cx=d

此时有:
g ( λ , ν ) = inf ⁡ x { f 0 ( x ) + λ T ( A x − b ) + ν T ( C x − d ) } = − b T λ − d T ν + inf ⁡ x { f 0 ( x ) + ( A T λ + C T ν ) T x } = − b T λ − d T ν − sup ⁡ x { − ( A T λ + C T ν ) T x − f 0 ( x ) } = − b T λ − d T ν − f 0 ∗ ( − A T λ − C T ν ) \begin{aligned} g(\boldsymbol{\lambda}, \boldsymbol{\nu}) &=\inf _{\mathbf{x}}\left\{f_0(\mathbf{x})+\boldsymbol{\lambda}^{\mathrm{T}}(\mathbf{A} \mathbf{x}-\mathbf{b})+\boldsymbol{\nu}^{\mathrm{T}}(\mathbf{C} \mathbf{x}-\mathbf{d})\right\} \\ &=-\mathbf{b}^{\mathrm{T}} \boldsymbol{\lambda}-\mathbf{d}^{\mathrm{T}} \boldsymbol{\nu}+\inf _{\mathbf{x}}\left\{f_0(\mathbf{x})+\left(\mathbf{A}^{\mathrm{T}} \boldsymbol{\lambda}+\mathbf{C}^{\mathrm{T}} \boldsymbol{\nu}\right)^{\mathrm{T}} \mathbf{x}\right\} \\ &=-\mathbf{b}^{\mathrm{T}} \boldsymbol{\lambda}-\mathbf{d}^{\mathrm{T}} \boldsymbol{\nu}-\sup _{\mathbf{x}}\left\{-\left(\mathbf{A}^{\mathrm{T}} \boldsymbol{\lambda}+\mathbf{C}^{\mathrm{T}} \boldsymbol{\nu}\right)^{\mathrm{T}} \mathbf{x}-f_0(\mathbf{x})\right\} \\ &=-\mathbf{b}^{\mathrm{T}} \boldsymbol{\lambda}-\mathbf{d}^{\mathrm{T}} \boldsymbol{\nu}-f_0^*\left(-\mathbf{A}^{\mathrm{T}} \boldsymbol{\lambda}-\mathbf{C}^{\mathrm{T}} \boldsymbol{\nu}\right) \end{aligned} g(λ,ν)=xinf{f0(x)+λT(Axb)+νT(Cxd)}=bTλdTν+xinf{f0(x)+(ATλ+CTν)Tx}=bTλdTνxsup{(ATλ+CTν)Txf0(x)}=bTλdTνf0(ATλCTν)

其中, dom ⁡ g = { ( λ , ν ) ∣ − ( A T λ + C T ν ) ∈ dom ⁡ f 0 ∗ } \operatorname{dom} g=\left\{(\boldsymbol{\lambda}, \boldsymbol{\nu}) \mid-\left(\mathbf{A}^{\mathrm{T}} \boldsymbol{\lambda}+\mathbf{C}^{\mathrm{T}} \boldsymbol{\nu}\right) \in \operatorname{dom} f_0^*\right\} domg={(λ,ν)(ATλ+CTν)domf0}

例如,最大熵问题:
max ⁡ { ∑ i = 1 n x i log ⁡ 1 x i } ≡ min ⁡ { f 0 ( x ) ≜ ∑ i = 1 n x i log ⁡ x i }  s.t.  x ∈ R + n , 1 n T x = 1  s.t.  x ∈ R + n , 1 n T x = 1 \begin{aligned} &\max \left\{\sum_{i=1}^n x_i \log \frac{1}{x_i}\right\} \equiv \min \left\{f_0(\mathbf{x}) \triangleq \sum_{i=1}^n x_i \log x_i\right\}\\ &\text { s.t. } \mathbf{x} \in \mathbb{R}_{+}^n, \mathbf{1}_n^{\mathrm{T}} \mathbf{x}=1 \quad \text { s.t. } \mathbf{x} \in \mathbb{R}_{+}^n, \mathbf{1}_n^{\mathrm{T}} \mathbf{x}=1 \end{aligned} max{i=1nxilogxi1}min{f0(x)i=1nxilogxi} s.t. xR+n,1nTx=1 s.t. xR+n,1nTx=1

由上面常见凸函数的共轭函数有:
f 0 ∗ ( y ) = sup ⁡ x ∈ R + n { y T x − f 0 ( x ) } = ∑ i = 1 n sup ⁡ x i ∈ R + { y i x i − x i log ⁡ x i } = ∑ i = 1 n e y i − 1 \begin{aligned} f_0^*(\mathbf{y}) &=\sup _{\mathbf{x} \in \mathbb{R}_{+}^n}\left\{\mathbf{y}^{\mathrm{T}} \mathbf{x}-f_0(\mathbf{x})\right\} \\ &=\sum_{i=1}^n \sup _{x_i \in \mathbb{R}_{+}}\left\{y_i x_i-x_i \log x_i\right\}=\sum_{i=1}^n \mathrm{e}^{y_i-1} \end{aligned} f0(y)=xR+nsup{yTxf0(x)}=i=1nxiR+sup{yixixilogxi}=i=1neyi1
其中, dom ⁡ f 0 ∗ = R n \operatorname{dom} f_0^*=\mathbb{R}^n domf0=Rn。令: A = − I n , b = 0 , C = 1 n T \mathbf{A}=-\mathbf{I}_n, \mathbf{b}=\mathbf{0}, \mathbf{C}=1_n^{\mathrm{T}} A=In,b=0,C=1nT,则有:

g ( λ , ν ) = − ν − f 0 ∗ ( λ − 1 n ν ) = − ν − ∑ i = 1 n e λ i − ν − 1 = − ν − e − ν − 1 ∑ i = 1 n e λ i \begin{aligned} g(\boldsymbol{\lambda}, \nu) &=-\nu-f_0^*\left(\boldsymbol{\lambda}-\mathbf{1}_n \nu\right) \\ &=-\nu-\sum_{i=1}^n \mathrm{e}^{\lambda_i-\nu-1}=-\nu-\mathrm{e}^{-\nu-1} \sum_{i=1}^n \mathrm{e}^{\lambda_i} \end{aligned} g(λ,ν)=νf0(λ1nν)=νi=1neλiν1=νeν1i=1neλi

总结优化问题(不一定为凸)的Lagrange对偶函数可以很容易地通过共轭函数得到。

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值