目录对偶性

第 18 章 对偶性Chapter 18 Duality

本章回顾优化中的对偶性原理。In this chapter, we review duality principles in optimization.

18.1 对偶范数18.1 Dual norms

本节引入对偶范数,因为它们在本书中很有用。We introduce in this section dual norms, since they are useful in this book.

定义 18.1.1(对偶范数)。Definition 18.1.1 (Dual norms).
给定范数 ∥u∥\|{\bm{u}}\|,其对偶范数为Given a norm ∥u∥\|{\bm{u}}\|, its dual is ∥v∥∗:=max⁡∥u∥≤1⟨u,v⟩.\|{\bm{v}}\|_{*}\coloneqq\max_{\|{\bm{u}}\|\leq 1}\langle{\bm{u}},{\bm{v}}\rangle.

因此,∥⋅∥\|\cdot\| 的对偶范数是由范数 ∥⋅∥\|\cdot\| 诱导的单位球的支撑函数,Therefore, the dual norm of ∥⋅∥\|\cdot\| is the support function of the unit ball induced by the norm ∥⋅∥\|\cdot\|,

B∥⋅∥:={u∈RD ⁣:∥u∥≤1}.B_{\|\cdot\|}\coloneqq\{{\bm{u}}\in\mathbb{R}^{D}\colon\|{\bm{u}}\|\leq 1\}.

下面给出若干对偶范数对的例子。We give examples of pairs of dual norms below.

例 18.1.2(pp-范数的对偶范数)。Example 18.1.2 (Dual norm of pp-norms).
pp-范数定义为The pp-norm is defined by ∥u∥p:=(∑j=1D∣uj∣p)1/p.\|{\bm{u}}\|_{p}\coloneqq\left(\sum_{j=1}^{D}|u_{j}|^{p}\right)^{1/p}. 其对偶为 ∥v∥q\|{\bm{v}}\|_{q},其中 qq 满足 1p+1q=1\frac{1}{p}+\frac{1}{q}=1。例如,22-范数的对偶范数就是它本身,因为 12+12=1\frac{1}{2}+\frac{1}{2}=1。11-范数与 ∞\infty-范数互为对偶,因为 11+1∞=1\frac{1}{1}+\frac{1}{\infty}=1。Its dual is ∥v∥q\|{\bm{v}}\|_{q} where qq is such that 1p+1q=1\frac{1}{p}+\frac{1}{q}=1. For instance, the dual norm of the 22-norm is itself, since 12+12=1\frac{1}{2}+\frac{1}{2}=1. The 11-norm and the ∞\infty-norm are duals of each other, since 11+1∞=1\frac{1}{1}+\frac{1}{\infty}=1.

对偶范数的定义蕴含了 柯西—施瓦茨 不等式的一种推广:对于所有 u,v∈RD{\bm{u}},{\bm{v}}\in\mathbb{R}^{D}The definition of dual norm implies a generalization of the Cauchy–Schwarz inequality: for all u,v∈RD{\bm{u}},{\bm{v}}\in\mathbb{R}^{D}

∣⟨u,v⟩∣≤∥u∥∗∥v∥.|\langle{\bm{u}},{\bm{v}}\rangle|\leq\|{\bm{u}}\|_{*}\|{\bm{v}}\|.

参见,例如,[18, 引理 1.4]。See, e.g., [18, Lemma 1.4].

命题 18.1.3(范数与平方范数的共轭)。Proposition 18.1.3 (Conjugate of norms and squared norms).
我们知道,支撑函数的共轭即指示函数。因此,若 f(u)=∥u∥f({\bm{u}})=\|{\bm{u}}\|,则We know that the conjugate of the support function is the indicator function. Therefore, if f(u)=∥u∥f({\bm{u}})=\|{\bm{u}}\|, then f∗(v)=ιB∥⋅∥(v)={0 if ∥v∥∗≤1∞ otherwise .f^{*}({\bm{v}})=\iota_{B_{\|\cdot\|}}({\bm{v}})=\begin{cases}0&\text{ if }\|{\bm{v}}\|_{*}\leq 1\\ \infty&\text{ otherwise }\end{cases}. 另一方面,若 f(u)=12∥u∥2f({\bm{u}})=\frac{1}{2}\|{\bm{u}}\|^{2},则On the other hand, if f(u)=12∥u∥2f({\bm{u}})=\frac{1}{2}\|{\bm{u}}\|^{2}, then f∗(v)=12∥v∥∗2.f^{*}({\bm{v}})=\frac{1}{2}\|{\bm{v}}\|^{2}_{*}.

18.2 Fenchel 对偶18.2 Fenchel duality

本节考虑如下形式的标准目标函数We consider in this section standard objectives of the form

min⁡w∈WL(w):=min⁡w∈Wℓ(f(w))+R(w),\min_{{\bm{w}}\in\mathcal{W}}L({\bm{w}})\coloneqq\min_{{\bm{w}}\in\mathcal{W}}\ell(f({\bm{w}}))+R({\bm{w}}),

其中 f ⁣:W→Mf\colon\mathcal{W}\to\mathcal{M}、ℓ ⁣:M→R\ell\colon\mathcal{M}\to\mathbb{R} 与 R ⁣:W→RR\colon\mathcal{W}\to\mathbb{R}。我们首先说明:即使原始问题是非凸的,该目标函数的极小化(称为原始问题)仍可被一个称为对偶的凹极大化目标函数从下方界定。where f ⁣:W→Mf\colon\mathcal{W}\to\mathcal{M}, ℓ ⁣:M→R\ell\colon\mathcal{M}\to\mathbb{R} and R ⁣:W→RR\colon\mathcal{W}\to\mathbb{R}. We first show that the minimization of this objective, called the primal, can be lower bounded by a concave maximization objective, called the dual, even if the primal is nonconvex.

命题 18.2.1(弱对偶性)。Proposition 18.2.1 (Weak duality).
设 f ⁣:W→Mf\colon\mathcal{W}\to\mathcal{M}(可能非线性)、ℓ ⁣:M→R\ell\colon\mathcal{M}\to\mathbb{R}(可能非凸)以及 R ⁣:W→RR\colon\mathcal{W}\to\mathbb{R}(可能非凸)。则Let f ⁣:W→Mf\colon\mathcal{W}\to\mathcal{M} (potentially nonlinear), ℓ ⁣:M→R\ell\colon\mathcal{M}\to\mathbb{R} (potentially nonconvex) and R ⁣:W→RR\colon\mathcal{W}\to\mathbb{R} (potentially nonconvex). Then min⁡w∈Wℓ(f(w))+R(w)≥max⁡α∈M−Rf(α)−ℓ∗(−α),\min_{{\bm{w}}\in\mathcal{W}}\ell(f({\bm{w}}))+R({\bm{w}})\geq\max_{{\bm{\alpha}}\in\mathcal{M}}-R^{f}({\bm{\alpha}})-\ell^{*}(-{\bm{\alpha}}), 其中我们使用了共轭where we used the conjugate ℓ∗(−α):=max⁡θ∈M⟨−α,θ⟩−ℓ(θ)\ell^{*}(-{\bm{\alpha}})\coloneqq\max_{{\bm{\theta}}\in\mathcal{M}}\langle-{\bm{\alpha}},{\bm{\theta}}\rangle-\ell({\bm{\theta}}) 以及“广义共轭”and the “generalized conjugate” Rf(α):=max⁡w∈W⟨α,f(w)⟩−R(w).R^{f}({\bm{\alpha}})\coloneqq\max_{{\bm{w}}\in\mathcal{W}}\langle{\bm{\alpha}},f({\bm{w}})\rangle-R({\bm{w}}). 此外,ℓ∗\ell^{*} 与 RfR^{f} 均为凸函数。Moreover, ℓ∗\ell^{*} and RfR^{f} are both convex functions.

我们强调,命题 18.2.1 中的结果具有完全的一般性,即它并不假设 ff 的线性性,也不假设 ℓ\ell 与 RR 的凸性。当然需要注意的是,若 ff 是非线性的,且 ℓ\ell 与 RR 是非凸的,则 RfR^{f} 与 ℓ∗\ell^{*} 一般难以计算。We emphasize that the result in Proposition 18.2.1 is fully general, in the sense that it does not assume the linearity of ff or the convexity of ℓ\ell and RR. The caveat, of course, is that RfR^{f} and ℓ∗\ell^{*} are difficult to compute in general, if ff is nonlinear, and if ℓ\ell and RR are nonconvex.

证明 18.2.2。Proof 18.2.2.
min⁡w∈Wℓ(f(w))+R(w)\displaystyle\min_{{\bm{w}}\in\mathcal{W}}\ell(f({\bm{w}}))+R({\bm{w}})
=\displaystyle= min⁡w∈Wθ∈Mℓ(θ)+R(w)s.t.θ=f(w)\displaystyle\min_{\begin{subarray}{c}{\bm{w}}\in\mathcal{W}\\ {\bm{\theta}}\in\mathcal{M}\end{subarray}}\ell({\bm{\theta}})+R({\bm{w}})\quad\text{s.t.}\quad{\bm{\theta}}=f({\bm{w}})
=\displaystyle= min⁡w∈Wθ∈Mmax⁡α∈Mℓ(θ)+R(w)+⟨α,θ−f(w)⟩\displaystyle\min_{\begin{subarray}{c}{\bm{w}}\in\mathcal{W}\\ {\bm{\theta}}\in\mathcal{M}\end{subarray}}\max_{{\bm{\alpha}}\in\mathcal{M}}\ell({\bm{\theta}})+R({\bm{w}})+\langle{\bm{\alpha}},{\bm{\theta}}-f({\bm{w}})\rangle
≥\displaystyle\geq max⁡α∈Mmin⁡w∈Wθ∈Mℓ(θ)+R(w)+⟨α,θ−f(w)⟩\displaystyle\max_{{\bm{\alpha}}\in\mathcal{M}}\min_{\begin{subarray}{c}{\bm{w}}\in\mathcal{W}\\ {\bm{\theta}}\in\mathcal{M}\end{subarray}}\ell({\bm{\theta}})+R({\bm{w}})+\langle{\bm{\alpha}},{\bm{\theta}}-f({\bm{w}})\rangle
=\displaystyle= max⁡α∈Mmin⁡w∈W⟨α,−f(w)⟩+R(w)+min⁡θ∈Mℓ(θ)+⟨α,θ⟩\displaystyle\max_{{\bm{\alpha}}\in\mathcal{M}}\min_{{\bm{w}}\in\mathcal{W}}\langle{\bm{\alpha}},-f({\bm{w}})\rangle+R({\bm{w}})+\min_{{\bm{\theta}}\in\mathcal{M}}\ell({\bm{\theta}})+\langle{\bm{\alpha}},{\bm{\theta}}\rangle
=\displaystyle= max⁡α∈M−max⁡w∈W⟨α,f(w)⟩−R(w)−max⁡θ∈M⟨−α,θ⟩−ℓ(θ)\displaystyle\max_{{\bm{\alpha}}\in\mathcal{M}}-\max_{{\bm{w}}\in\mathcal{W}}\langle{\bm{\alpha}},f({\bm{w}})\rangle-R({\bm{w}})-\max_{{\bm{\theta}}\in\mathcal{M}}\langle-{\bm{\alpha}},{\bm{\theta}}\rangle-\ell({\bm{\theta}})
=\displaystyle= max⁡α∈M−Rf(α)−ℓ∗(−α).\displaystyle\max_{{\bm{\alpha}}\in\mathcal{M}}-R^{f}({\bm{\alpha}})-\ell^{*}(-{\bm{\alpha}}).

当 f(w)=Awf({\bm{w}})=A{\bm{w}}(其中 AA 是线性映射),且 ℓ\ell 与 RR 均为凸时,我们可以得到一个强得多的结果。In the case when f(w)=Awf({\bm{w}})=A{\bm{w}}, where AA is a linear map, and when both ℓ\ell and RR are convex, we can state a much stronger result.

命题 18.2.3(强对偶性)。Proposition 18.2.3 (Strong duality).
设 AA 为从 W\mathcal{W} 到 M\mathcal{M} 的线性映射,ℓ ⁣:M→R\ell\colon\mathcal{M}\to\mathbb{R} 与 R ⁣:W→RR\colon\mathcal{W}\to\mathbb{R} 为凸函数,A∗A^{*} 表示 AA 的伴随(见第 2.3 节)。则Let AA be a linear map from W\mathcal{W} to M\mathcal{M}. Let ℓ ⁣:M→R\ell\colon\mathcal{M}\to\mathbb{R} and R ⁣:W→RR\colon\mathcal{W}\to\mathbb{R} be convex functions. Let A∗A^{*} denote the adjoint of AA (Section 2.3). Then, min⁡w∈Wℓ(Aw)+R(w)=max⁡α∈M−R∗(A∗α)−ℓ∗(−α).\min_{{\bm{w}}\in\mathcal{W}}\ell(A{\bm{w}})+R({\bm{w}})=\max_{{\bm{\alpha}}\in\mathcal{M}}-R^{*}(A^{*}{\bm{\alpha}})-\ell^{*}(-{\bm{\alpha}}). 此外,原问题的解满足Furthermore, the primal solution satisfies w⋆∈arg max⁡w∈W⟨Aα⋆,w⟩−R(w).{\bm{w}}^{\star}\in\argmax_{{\bm{w}}\in\mathcal{W}}\langle A{\bm{\alpha}}^{\star},{\bm{w}}\rangle-R({\bm{w}}). 当 RR 为严格凸时,原问题的解由下式唯一确定:When RR is strictly convex, the primal solution is uniquely determined by w⋆=∇R∗(A∗α⋆).{\bm{w}}^{\star}=\nabla R^{*}(A^{*}{\bm{\alpha}}^{\star}).
证明 18.2.4。Proof 18.2.4.

由 f(w)=Awf({\bm{w}})=A{\bm{w}},可得Since f(w)=Awf({\bm{w}})=A{\bm{w}}, we have

Rf(α)\displaystyle R^{f}({\bm{\alpha}}) :=max⁡w∈W⟨α,f(w)⟩−R(w)\displaystyle\coloneqq\max_{{\bm{w}}\in\mathcal{W}}\langle{\bm{\alpha}},f({\bm{w}})\rangle-R({\bm{w}})
=max⁡w∈W⟨α,Aw⟩−R(w)\displaystyle=\max_{{\bm{w}}\in\mathcal{W}}\langle{\bm{\alpha}},A{\bm{w}}\rangle-R({\bm{w}})
=max⁡w∈W⟨A∗α,w⟩−R(w)\displaystyle=\max_{{\bm{w}}\in\mathcal{W}}\langle A^{*}{\bm{\alpha}},{\bm{w}}\rangle-R({\bm{w}})
=R∗(A∗α).\displaystyle=R^{*}(A^{*}{\bm{\alpha}}).

此外,命题18.2.1的证明中的不等式取等号,因为min⁡max⁡\min\max是某个凸—凹函数的对应量。Furthermore, the inequality in the proof of Proposition 18.2.1 is an equality, since the min⁡max⁡\min\max is that of a convex-concave function.

命题 18.2.3 中的极大化问题称为 Fenchel 对偶。由强对偶性可知,最大值与最小值相等。因此,我们可以等价地选择求解对偶问题,而非原始问题。当空间 M\mathcal{M} 小于 W\mathcal{W} 时,这样做尤为有利。The maximization problem in Proposition 18.2.3 is called the Fenchel dual. By strong duality, the value of the maximum and the value of the minimum are equal. We can therefore choose to equivalently solve the dual instead of the primal. This can be advantageous when the space M\mathcal{M} is smaller than W\mathcal{W}.

下面我们应用 Fenchel 对偶,得到正则化多分类线性分类问题的对偶。We now apply the Fenchel dual to obtain the dual of regularized multiclass linear classification.

例 18.2.5(可分离损失函数之和)。Example 18.2.5 (Sum of separable loss functions).
当损失为 ℓ(θ):=∑i=1Nℓi(θi)\ell({\bm{\theta}})\coloneqq\sum_{i=1}^{N}\ell_{i}({\bm{\theta}}_{i}) 时,其中 θ=Aw=(A1w,…,ANw)∈MN{\bm{\theta}}=A{\bm{w}}=(A_{1}{\bm{w}},\dots,A_{N}{\bm{w}})\in\mathcal{M}^{N},而 AiA_{i} 为从 W\mathcal{W} 到 M\mathcal{M} 的线性映射,可得When the loss is
ℓ(θ):=∑i=1Nℓi(θi)\ell({\bm{\theta}})\coloneqq\sum_{i=1}^{N}\ell_{i}({\bm{\theta}}_{i}), where θ=Aw=(A1w,…,ANw)∈MN{\bm{\theta}}=A{\bm{w}}=(A_{1}{\bm{w}},\dots,A_{N}{\bm{w}})\in\mathcal{M}^{N} and AiA_{i} is a linear map from W\mathcal{W} to M\mathcal{M}, we obtain
min⁡w∈W∑i=1Nℓi(Aiw)+R(w)=max⁡α∈MN−R∗(A∗α)−∑i=1Nℓi∗(−αi),\min_{{\bm{w}}\in\mathcal{W}}\sum_{i=1}^{N}\ell_{i}(A_{i}{\bm{w}})+R({\bm{w}})=\max_{{\bm{\alpha}}\in\mathcal{M}^{N}}-R^{*}(A^{*}{\bm{\alpha}})-\sum_{i=1}^{N}\ell_{i}^{*}(-{\bm{\alpha}}_{i}), 其中 A∗α=(A1∗α1,…,AN∗αN)A^{*}{\bm{\alpha}}=(A_{1}^{*}{\bm{\alpha}}_{1},\dots,A_{N}^{*}{\bm{\alpha}}_{N})。通常,我们定义where A∗α=(A1∗α1,…,AN∗αN)A^{*}{\bm{\alpha}}=(A_{1}^{*}{\bm{\alpha}}_{1},\dots,A_{N}^{*}{\bm{\alpha}}_{N}). Typically, we define Aiw:=Wxi,A_{i}{\bm{w}}\coloneqq{\bm{W}}{\bm{x}}_{i}, 其中 W∈RM×D{\bm{W}}\in\mathbb{R}^{M\times D} 是 w∈W{\bm{w}}\in\mathcal{W} 经重塑后的版本,xi∈RD{\bm{x}}_{i}\in\mathbb{R}^{D} 为一个训练样本,MM 为类别数。此时可得where W∈RM×D{\bm{W}}\in\mathbb{R}^{M\times D} is a reshaped version of w∈W{\bm{w}}\in\mathcal{W}, xi∈RD{\bm{x}}_{i}\in\mathbb{R}^{D} is a training sample, and MM is the number of classes. In this case, we then have Ai∗αi=αixi⊤.A_{i}^{*}{\bm{\alpha}}_{i}={\bm{\alpha}}_{i}{\bm{x}}_{i}^{\top}.

损失函数的共轭示例见表 18.1。Examples of loss function conjugates are given in Table 18.1.

表 18.1:损失共轭的示例。对于回归损失(平方损失、绝对损失),其中 yi∈RM{\bm{y}}_{i}\in\mathbb{R}^{M},我们定义 ti=ϕ(yi)=yi{\bm{t}}_{i}=\phi({\bm{y}}_{i})={\bm{y}}_{i}。对于分类损失(logistic 损失、感知机损失、合页损失),其中 yi∈[M]y_{i}\in[M],我们定义 ti=ϕ(yi)=eyi{\bm{t}}_{i}=\phi(y_{i})={\bm{e}}_{y_{i}}。为简化部分表达式,我们作了变量替换 μi:=yi−αi{\bm{\mu}}_{i}\coloneqq{\bm{y}}_{i}-{\bm{\alpha}}_{i}。Table 18.1: Examples of loss conjugates. For regression losses (squared, absolute), where yi∈RM{\bm{y}}_{i}\in\mathbb{R}^{M}, we define ti=ϕ(yi)=yi{\bm{t}}_{i}=\phi({\bm{y}}_{i})={\bm{y}}_{i}. For classification losses (logistic, perceptron, hinge), where yi∈[M]y_{i}\in[M], we define ti=ϕ(yi)=eyi{\bm{t}}_{i}=\phi(y_{i})={\bm{e}}_{y_{i}}. To simplify some expressions, we defined the change of variable μi:=yi−αi{\bm{\mu}}_{i}\coloneqq{\bm{y}}_{i}-{\bm{\alpha}}_{i}.
ℓi(θi)\ell_{i}({\bm{\theta}}_{i}) ℓi∗(−αi)\ell_{i}^{*}(-{\bm{\alpha}}_{i})
平方Squared 12∥θi−ti∥22\frac{1}{2}\|{\bm{\theta}}_{i}-{\bm{t}}_{i}\|^{2}_{2} 12∥αi∥22−⟨ti,αi⟩\frac{1}{2}\|{\bm{\alpha}}_{i}\|^{2}_{2}-\langle{\bm{t}}_{i},{\bm{\alpha}}_{i}\rangle
绝对Absolute ∥θi−ti∥1\|{\bm{\theta}}_{i}-{\bm{t}}_{i}\|_{1} ι[−1,1]M(αi)−⟨ti,αi⟩\iota_{[-1,1]^{M}}({\bm{\alpha}}_{i})-\langle{\bm{t}}_{i},{\bm{\alpha}}_{i}\rangle
logisticLogistic LSE(θi)−⟨θi,ti⟩\mathrm{LSE}({\bm{\theta}}_{i})-\langle{\bm{\theta}}_{i},{\bm{t}}_{i}\rangle ⟨μi,log⁡μi⟩+ι△M(μi)\langle{\bm{\mu}}_{i},\log{\bm{\mu}}_{i}\rangle+\iota_{\triangle^{M}}({\bm{\mu}}_{i})
感知机Perceptron max⁡j∈[M]θi,j−θi,yi\max_{j\in[M]}\theta_{i,j}-\theta_{i,y_{i}} ι△M(μi)\iota_{\triangle^{M}}({\bm{\mu}}_{i})
合页Hinge max⁡j∈[M][j≠yi]+θi,j−θi,yi\max_{j\in[M]}[j\neq y_{i}]+\theta_{i,j}-\theta_{i,y_{i}} ι△M(μi)−⟨1⁡−ti,μi⟩\iota_{\triangle^{M}}({\bm{\mu}}_{i})-\langle\operatorname{\mathbf{1}}-{\bm{t}}_{i},{\bm{\mu}}_{i}\rangle

18.3 Bregman 散度18.3 Bregman divergences

Bregman 散度用于度量两点之间的差异。Bregman divergences are a measure of difference between two points.

定义 18.3.1(Bregman 散度)。Definition 18.3.1 (Bregman divergence).
由可微凸函数 f ⁣:RD→Rf\colon\mathbb{R}^{D}\to\mathbb{R} 生成的 Bregman 散度为The Bregman divergence generated by a differentiable convex function f ⁣:RD→Rf\colon\mathbb{R}^{D}\to\mathbb{R} is Bf(u,v)\displaystyle B_{f}({\bm{u}},{\bm{v}}) :=f(u)−f(v)−⟨∇f(v),u−v⟩\displaystyle\coloneqq f({\bm{u}})-f({\bm{v}})-\langle\nabla f({\bm{v}}),{\bm{u}}-{\bm{v}}\rangle =⟨∇f(v),v⟩−f(v)−[⟨∇f(v),u⟩−f(u)],\displaystyle=\langle\nabla f({\bm{v}}),{\bm{v}}\rangle-f({\bm{v}})-\left[\langle\nabla f({\bm{v}}),{\bm{u}}\rangle-f({\bm{u}})\right], 其中 u,v∈dom⁡(f){\bm{u}},{\bm{v}}\in\dom(f)。where u,v∈dom⁡(f){\bm{u}},{\bm{v}}\in\dom(f).

直观地说,Bregman 散度是 f(u)f({\bm{u}}) 与其在 v{\bm{v}} 附近的线性化 u↦f(v)+⟨∇f(v),u−v⟩{\bm{u}}\mapsto f({\bm{v}})+\langle\nabla f({\bm{v}}),{\bm{u}}-{\bm{v}}\rangle 之差。这一点如图 18.1 所示。Intuitively, the Bregman divergence is the difference between f(u)f({\bm{u}}) and its linearization u↦f(v)+⟨∇f(v),u−v⟩{\bm{u}}\mapsto f({\bm{v}})+\langle\nabla f({\bm{v}}),{\bm{u}}-{\bm{v}}\rangle around v{\bm{v}}. This is illustrated in Fig. 18.1.

例 18.3.2(Bregman 散度的示例)。Example 18.3.2 (Examples of Bregman divergences).
若 f(u)=12∥u∥22f({\bm{u}})=\frac{1}{2}\|{\bm{u}}\|^{2}_{2},其中 dom⁡(f)=RD\dom(f)=\mathbb{R}^{D},则得到If f(u)=12∥u∥22f({\bm{u}})=\frac{1}{2}\|{\bm{u}}\|^{2}_{2}, where dom⁡(f)=RD\dom(f)=\mathbb{R}^{D}, then Bf(u,v)=12∥u−v∥22,B_{f}({\bm{u}},{\bm{v}})=\frac{1}{2}\|{\bm{u}}-{\bm{v}}\|^{2}_{2}, 平方欧几里得距离。若 f(u)=⟨u,log⁡u⟩f({\bm{u}})=\langle{\bm{u}},\log{\bm{u}}\rangle,其中 dom⁡(f)=R+D\dom(f)=\mathbb{R}_{+}^{D},则得到the squared Euclidean distance. If f(u)=⟨u,log⁡u⟩f({\bm{u}})=\langle{\bm{u}},\log{\bm{u}}\rangle, where dom⁡(f)=R+D\dom(f)=\mathbb{R}_{+}^{D}, then Bf(u,v)=∑j=1Dujlog⁡ujvj−∑j=1Duj+∑j=1Dvj,B_{f}({\bm{u}},{\bm{v}})=\sum_{j=1}^{D}u_{j}\log\frac{u_{j}}{v_{j}}-\sum_{j=1}^{D}u_{j}+\sum_{j=1}^{D}v_{j}, (广义)Kullback-Leibler 散度。the (generalized) Kullback-Leibler divergence.

性质Properties

Bregman 散度具有若干有用的性质。Bregman divergences enjoy several useful properties.

命题 18.3.3(Bregman 散度的性质)。Proposition 18.3.3 (Properties of Bregman divergences).
设 f ⁣:RD→Rf\colon\mathbb{R}^{D}\to\mathbb{R} 为可微凸函数。Let f ⁣:RD→Rf\colon\mathbb{R}^{D}\to\mathbb{R} be a differentiable convex function. 1. 非负性:对任意 u,v∈dom⁡(f){\bm{u}},{\bm{v}}\in\dom(f),均有 Bf(u,v)≥0B_{f}({\bm{u}},{\bm{v}})\geq 0。Non-negativity: Bf(u,v)≥0B_{f}({\bm{u}},{\bm{v}})\geq 0 for all u,v∈dom⁡(f){\bm{u}},{\bm{v}}\in\dom(f). 2. 正性:Bf(u,v)=0B_{f}({\bm{u}},{\bm{v}})=0 当且仅当 u=v{\bm{u}}={\bm{v}}(此时 ff 为严格凸)。Positivity: Bf(u,v)=0B_{f}({\bm{u}},{\bm{v}})=0 if and only if u=v{\bm{u}}={\bm{v}} (when ff is strictly convex). 3. 凸性:Bf(u,v)B_{f}({\bm{u}},{\bm{v}}) 关于 u{\bm{u}} 是凸的。Convexity: Bf(u,v)B_{f}({\bm{u}},{\bm{v}}) is convex in u{\bm{u}}. 4. 对偶空间形式:Bf(u,v)=Bf∗(b,a)B_{f}({\bm{u}},{\bm{v}})=B_{f^{*}}({\bm{b}},{\bm{a}}),其中 b=∇f(v)∈dom⁡(f∗){\bm{b}}=\nabla f({\bm{v}})\in\dom(f^{*}),a=∇f(u)∈dom⁡(f∗){\bm{a}}=\nabla f({\bm{u}})\in\dom(f^{*})。Dual-space form: Bf(u,v)=Bf∗(b,a)B_{f}({\bm{u}},{\bm{v}})=B_{f^{*}}({\bm{b}},{\bm{a}}), where b=∇f(v)∈dom⁡(f∗){\bm{b}}=\nabla f({\bm{v}})\in\dom(f^{*}) and a=∇f(u)∈dom⁡(f∗){\bm{a}}=\nabla f({\bm{u}})\in\dom(f^{*}).
证明 18.3.4。Proof 18.3.4.

这些性质均可由 f(u)f({\bm{u}}) 的凸性直接得到。The properties follow immediately from the convexity of f(u)f({\bm{u}}).

  1. 1.

    由定义 15.4.10 即得。From Definition 15.4.10.

  2. 2.

    由极小值点的唯一性即得。From the uniqueness of minimizers.

  3. 3.

    这源于如下事实:u↦Bf(u,v){\bm{u}}\mapsto B_{f}({\bm{u}},{\bm{v}}) 是 f(u)f({\bm{u}}) 与 u{\bm{u}} 的一个线性函数之和。From the fact that u↦Bf(u,v){\bm{u}}\mapsto B_{f}({\bm{u}},{\bm{v}}) is the sum of f(u)f({\bm{u}}) and a linear function of u{\bm{u}}.

图 18.1:由 ff 生成的 Bregman 散度,即 f(u)f({\bm{u}}) 与其在 v{\bm{v}} 附近的线性化之差。Figure 18.1: The Bregman divergence generated by ff is the difference between f(u)f({\bm{u}}) and its linearization around v{\bm{v}}.

Bregman 散度可用于定义欧几里得投影与邻近算子的自然推广;这些内容已在 16.3 节与 16.4 节中回顾。The Bregman divergence can be used to define natural generalizations of the Euclidean projection and proximal operators, reviewed in Section 16.3 and Section 16.4.

定义 18.3.5(Bregman 邻近算子与投影算子)。Definition 18.3.5 (Bregman proximal and projection operators).
设 v∈dom⁡(f){\bm{v}}\in\dom(f)。Bregman 近端算子为Let v∈dom⁡(f){\bm{v}}\in\dom(f). The Bregman proximal operator is bproxf,g(v):=arg min⁡u∈dom⁡(f)∩dom⁡(g)Bf(u,v)+g(u).\mathrm{bprox}_{f,g}({\bm{v}})\coloneqq\argmin_{{\bm{u}}\in\dom(f)\cap\dom(g)}B_{f}({\bm{u}},{\bm{v}})+g({\bm{u}}). 特别地,到 C⊆dom⁡(f)\mathcal{C}\subseteq\dom(f) 上的 Bregman 投影为In particular, the Bregman projection onto C⊆dom⁡(f)\mathcal{C}\subseteq\dom(f) is bprojf,C(v):=arg min⁡u∈CBf(u,v).\mathrm{bproj}_{f,\mathcal{C}}({\bm{v}})\coloneqq\argmin_{{\bm{u}}\in\mathcal{C}}B_{f}({\bm{u}},{\bm{v}}).

事实证明,这些算子与凸共轭的梯度映射密切相关。It turns out that these operators are intimately connected to the gradient mapping of the convex conjugate.

命题 18.3.6(与共轭的梯度的联系)。Proposition 18.3.6 (Link with conjugate’s gradient).
若 Ω=f+g\Omega=f+g,则对任意 θ∈dom⁡(f∗){\bm{\theta}}\in\dom(f^{*}),If Ω=f+g\Omega=f+g, then for all θ∈dom⁡(f∗){\bm{\theta}}\in\dom(f^{*}) ∇Ω∗(θ)=bproxf,g(∇f∗(θ)).\nabla\Omega^{*}({\bm{\theta}})=\mathrm{bprox}_{f,g}(\nabla f^{*}({\bm{\theta}})). 特别地,若 Ω=f+ιC\Omega=f+\iota_{\mathcal{C}},则对任意 θ∈dom⁡(f∗){\bm{\theta}}\in\dom(f^{*}),In particular, if Ω=f+ιC\Omega=f+\iota_{\mathcal{C}}, then for all θ∈dom⁡(f∗){\bm{\theta}}\in\dom(f^{*}) ∇Ω∗(θ)=bprojf,C(∇f∗(θ)).\nabla\Omega^{*}({\bm{\theta}})=\mathrm{bproj}_{f,\mathcal{C}}(\nabla f^{*}({\bm{\theta}})).

下面给出两个例子。We give two examples below.

例 18.3.7(单纯形上的 Bregman 投影)。Example 18.3.7 (Bregman projections on the simplex).
若 f(u)=12∥u∥22f({\bm{u}})=\frac{1}{2}\|{\bm{u}}\|^{2}_{2},则If f(u)=12∥u∥22f({\bm{u}})=\frac{1}{2}\|{\bm{u}}\|^{2}_{2}, then bprojf,△D(v)=arg min⁡u∈△D12∥u−v∥22.\displaystyle\mathrm{bproj}_{f,\triangle^{D}}({\bm{v}})=\argmin_{{\bm{u}}\in\triangle^{D}}\frac{1}{2}\|{\bm{u}}-{\bm{v}}\|^{2}_{2}. 若 f(u)=⟨u,log⁡u−1⁡⟩f({\bm{u}})=\langle{\bm{u}},\log{\bm{u}}-\operatorname{\mathbf{1}}\rangle,则If f(u)=⟨u,log⁡u−1⁡⟩f({\bm{u}})=\langle{\bm{u}},\log{\bm{u}}-\operatorname{\mathbf{1}}\rangle, then bprojf,△D(v)=arg min⁡u∈△DKL(u,v)=softargmax(θ),\displaystyle\mathrm{bproj}_{f,\triangle^{D}}({\bm{v}})=\argmin_{{\bm{u}}\in\triangle^{D}}\mathrm{KL}({\bm{u}},{\bm{v}})=\mathrm{softargmax}({\bm{\theta}}), 其中 v=∇f∗(θ)=exp⁡(θ){\bm{v}}=\nabla f^{*}({\bm{\theta}})=\exp({\bm{\theta}})。where v=∇f∗(θ)=exp⁡(θ){\bm{v}}=\nabla f^{*}({\bm{\theta}})=\exp({\bm{\theta}}).

因此,softmax 可以看作是在 Kullback-Leibler 散度意义下向概率单纯形上的投影!Therefore, the softmax can be seen as a projection onto the probability simplex in the Kullback-Leibler divergence sense!

18.4 Fenchel-Young 损失函数18.4 Fenchel-Young loss functions

我们以对 Fenchel-Young 损失函数族 [28] 的简要回顾来结束本章,该损失函数族包含表 18.1 中的所有损失函数。We end this chapter with a brief review of the Fenchel-Young family of loss functions [28], which includes all loss functions in Table 18.1.

定义 18.4.1(Fenchel-Young 损失)。Definition 18.4.1 (Fenchel-Young loss).
由 Ω\Omega 生成的 Fenchel-Young 损失函数为The Fenchel-Young loss function generated by Ω\Omega is ℓΩ(θ,t):=Ω∗(θ)+Ω(t)−⟨θ,t⟩\ell_{\Omega}({\bm{\theta}},{\bm{t}})\coloneqq\Omega^{*}({\bm{\theta}})+\Omega({\bm{t}})-\langle{\bm{\theta}},{\bm{t}}\rangle 其中 θ∈dom⁡(Ω∗){\bm{\theta}}\in\dom(\Omega^{*}),t∈dom⁡(Ω){\bm{t}}\in\dom(\Omega)。where θ∈dom⁡(Ω∗){\bm{\theta}}\in\dom(\Omega^{*}) and t∈dom⁡(Ω){\bm{t}}\in\dom(\Omega).

通常,我们令 θ=f(x,w){\bm{\theta}}=f({\bm{x}},{\bm{w}}),其中 ff 是带有参数 w{\bm{w}} 的模型预测函数,且 t=ϕ(y){\bm{t}}=\phi({\bm{y}}),其中 ϕ ⁣:Y→dom⁡(Ω)\phi\colon\mathcal{Y}\to\dom(\Omega)。例如,假设我们处理的是 分类输出 y∈[M]y\in[M]。那么,我们可以令 ϕ(y)=ey\phi(y)={\bm{e}}_{y},其中 ey{\bm{e}}_{y} 是 yy 的 one-hot 编码。Typically, we set θ=f(x,w){\bm{\theta}}=f({\bm{x}},{\bm{w}}), where ff is a model prediction function with parameters w{\bm{w}} and t=ϕ(y){\bm{t}}=\phi({\bm{y}}), where ϕ ⁣:Y→dom⁡(Ω)\phi\colon\mathcal{Y}\to\dom(\Omega). For instance, suppose we work with categorical outputs y∈[M]y\in[M]. Then, we can set ϕ(y)=ey\phi(y)={\bm{e}}_{y}, where ey{\bm{e}}_{y} is the one-hot encoding of yy.

需要注意的重要一点是,Fenchel-Young 损失定义在混合空间中的变量上:θ{\bm{\theta}} 属于对偶空间,而 t{\bm{t}} 属于原始空间。事实上,Fenchel-Young 损失与 Bregman 散度密切相关:若令 θ=∇Ω(v){\bm{\theta}}=\nabla\Omega({\bm{v}}),则 BΩ(t,v)=Ω∗(θ)+Ω(t)−⟨θ,t⟩B_{\Omega}({\bm{t}},{\bm{v}})=\Omega^{*}({\bm{\theta}})+\Omega({\bm{t}})-\langle{\bm{\theta}},{\bm{t}}\rangle。Fenchel-Young 损失函数的关键性质总结如下。The important point to notice is that the Fenchel-Young loss is defined over arguments in mixed spaces: θ{\bm{\theta}} belongs to the dual space, while t{\bm{t}} belongs to the primal space. In fact, the Fenchel-Young loss is intimately connected to the Bregman divergence, since BΩ(t,v)=Ω∗(θ)+Ω(t)−⟨θ,t⟩B_{\Omega}({\bm{t}},{\bm{v}})=\Omega^{*}({\bm{\theta}})+\Omega({\bm{t}})-\langle{\bm{\theta}},{\bm{t}}\rangle, if we set θ=∇Ω(v){\bm{\theta}}=\nabla\Omega({\bm{v}}). The key properties of Fenchel-Young loss functions are summarized below.

命题 18.4.2(Fenchel-Young 损失函数的性质)。Proposition 18.4.2 (Properties of Fenchel-Young loss functions).
1. 非负性:对任意 θ∈dom⁡(Ω∗){\bm{\theta}}\in\dom(\Omega^{*}) 与 t∈dom⁡(Ω){\bm{t}}\in\dom(\Omega),均有 ℓΩ(θ,t)≥0\ell_{\Omega}({\bm{\theta}},{\bm{t}})\geq 0。Non-negativity: ℓΩ(θ,t)≥0\ell_{\Omega}({\bm{\theta}},{\bm{t}})\geq 0 for all θ∈dom⁡(Ω∗){\bm{\theta}}\in\dom(\Omega^{*}) and t∈dom⁡(Ω){\bm{t}}\in\dom(\Omega). 2. 正性:若 Ω\Omega 为严格凸函数,则 ℓΩ(θ,t)=0\ell_{\Omega}({\bm{\theta}},{\bm{t}})=0 当且仅当 ∇Ω∗(θ)=t\nabla\Omega^{*}({\bm{\theta}})={\bm{t}}。Positivity: ℓΩ(θ,t)=0\ell_{\Omega}({\bm{\theta}},{\bm{t}})=0 if and only if ∇Ω∗(θ)=t\nabla\Omega^{*}({\bm{\theta}})={\bm{t}}, assuming Ω\Omega is strictly convex. 3. 凸性:ℓΩ(θ,t)\ell_{\Omega}({\bm{\theta}},{\bm{t}}) 关于 θ{\bm{\theta}} 为凸(无论 Ω\Omega 如何),且当 Ω\Omega 为凸时,关于 t{\bm{t}} 亦为凸。Convexity: ℓΩ(θ,t)\ell_{\Omega}({\bm{\theta}},{\bm{t}}) is convex in θ{\bm{\theta}} (regardless of Ω\Omega) and in t{\bm{t}} (if Ω\Omega is convex). 4. 与复合 Bregman 散度的关系:Relation with composite Bregman divergence: 0≤BΩ(t,∇Ω∗(θ))⏟possibly nonconvex in θ≤ℓΩ(θ,t)⏟convex in θ.0\leq\underbrace{B_{\Omega}({\bm{t}},\nabla\Omega^{*}({\bm{\theta}}))}_{\text{possibly nonconvex in }{\bm{\theta}}}\leq\underbrace{\ell_{\Omega}({\bm{\theta}},{\bm{t}})}_{\text{convex in }{\bm{\theta}}}.

关于更多性质的深入研究,参见 [28]。See [28] for an in-depth study of more properties.

18.5 小结18.5 Summary

  • •

    凸共轭是 Fenchel 对偶中的一个强大抽象工具,它将对偶表达式与特定于函数的项解耦。The convex conjugate serves as a powerful abstraction in Fenchel duality, decoupling the dual expression and function-specific terms.

  • •

    凸共轭也与 Bregman 散度紧密相连,并可用于导出 Fenchel-Young 损失函数族,后者可以看作原始—对偶的 Bregman 散度。The convex conjugate is also tightly connected to Bregman divergences and can be used to derive the family of Fenchel-Young loss functions, which can be seen as primal-dual Bregman divergences.