プリンキピア

第12章最適化アルゴリズム

12.2.2. Properties12.2.2 性質

Convex functions have many useful properties. We describe a few commonly-used ones below.
英語のヒント
凸関数には役に立つ性質がたくさんある。以下では、よく使われるものをいくつか説明する。

12.2.2.1. Local Minima Are Global Minima12.2.2.1 局所的な最小値は大域的な最小値である

First and foremost, the local minima of convex functions are also the global minima. We can prove it by contradiction as follows.
英語のヒント
何よりもまず、凸関数の局所的な最小値は大域的な最小値でもある。これは次のように背理法で証明できる。
Consider a convex function f defined on a convex set 𝒳. Suppose that x∗∈𝒳 is a local minimum: there exists a small positive value p so that for x∈𝒳 that satisfies 0<|x−x∗|≤p we have f(x∗)<f(x).
英語のヒント
凸集合𝒳上で定義された凸関数fを考える。x∗∈𝒳が局所的な最小値であるとする。つまり、小さな正の値pがあって、0<|x−x∗|≤pを満たすx∈𝒳についてf(x∗)<f(x)が成り立つ。
Assume that the local minimum x∗ is not the global minimum of f: there exists x′∈𝒳 for which f(x′)<f(x∗). There also exists λ∈[0,1) such as λ=1−p|x∗−x′| so that 0<|λx∗+(1−λ)x′−x∗|≤p.
英語のヒント
局所的な最小値x∗がfの大域的な最小値ではないと仮定する。つまり、f(x′)<f(x∗)となるx′∈𝒳がある。また、0<|λx∗+(1−λ)x′−x∗|≤pとなるようなλ∈[0,1)、たとえばλ=1−p|x∗−x′|もある。
However, according to the definition of convex functions, we have
英語のヒント
しかし、凸関数の定義により、次が成り立つ。
f(λx∗+(1−λ)x′)≤λf(x∗)+(1−λ)f(x′)<λf(x∗)+(1−λ)f(x∗)=f(x∗),(12.2.5)
which contradicts with our statement that x∗ is a local minimum. Therefore, there does not exist x′∈𝒳 for which f(x′)<f(x∗). The local minimum x∗ is also the global minimum.
英語のヒント
これは、x∗が局所的な最小値であるという主張と矛盾する。したがって、f(x′)<f(x∗)となるx′∈𝒳は存在しない。局所的な最小値x∗は大域的な最小値でもある。
For instance, the convex function f(x)=(x−1)2 has a local minimum at x=1, which is also the global minimum.
英語のヒント
たとえば、凸関数f(x)=(x−1)2はx=1で局所的な最小値をとり、それは大域的な最小値でもある。
f = lambda x: (x - 1) ** 2
d2l.set_figsize()
d2l.plot([x, segment], [f(x), f(segment)], 'x', 'f(x)')
The fact that the local minima for convex functions are also the global minima is very convenient. It means that if we minimize functions we cannot “get stuck”. Note, though, that this does not mean that there cannot be more than one global minimum or that there might even exist one. For instance, the function f(x)=max(|x|−1,0) attains its minimum value over the interval [−1,1]. Conversely, the function f(x)=exp⁡(x) does not attain a minimum value on ℝ: for x→−∞ it asymptotes to 0, but there is no x for which f(x)=0.
英語のヒント
凸関数の局所的な最小値が大域的な最小値でもあるという事実は、とても都合がよい。それは、関数を最小化するときに「はまり込む」ことがありえないという意味である。しかし、これは、大域的な最小値が一つしかありえないという意味でも、そもそも大域的な最小値が存在するという意味でもないことに注意してほしい。たとえば、関数f(x)=max(|x|−1,0)は区間[−1,1]全体で最小値をとる。逆に、関数f(x)=exp⁡(x)はℝ上で最小値をとらない。x→−∞のとき0に漸近するが、f(x)=0となるxはない。

12.2.2.2. Below Sets of Convex Functions Are Convex12.2.2.2 凸関数の下位集合は凸である

We can conveniently define convex sets via below sets of convex functions. Concretely, given a convex function f defined on a convex set 𝒳, any below set
英語のヒント
凸関数の下位集合を使うと、凸集合を手軽に定義できる。具体的には、凸集合𝒳上で定義された凸関数fが与えられたとき、次の下位集合を考える。
𝒮b=def{x|x∈𝒳 and f(x)≤b}(12.2.6)
is convex.
英語のヒント
このような下位集合は、どれも凸である。
Let’s prove this quickly. Recall that for any x,x′∈𝒮b we need to show that λx+(1−λ)x′∈𝒮b as long as λ∈[0,1]. Since f(x)≤b and f(x′)≤b, by the definition of convexity we have
英語のヒント
これを手早く証明しよう。どのx,x′∈𝒮bについても、λ∈[0,1]である限りλx+(1−λ)x′∈𝒮bとなることを示せばよいことを思い出そう。f(x)≤bかつf(x′)≤bなので、凸性の定義により次が成り立つ。
f(λx+(1−λ)x′)≤λf(x)+(1−λ)f(x′)≤b.(12.2.7)

12.2.2.3. Convexity and Second Derivatives12.2.2.3 凸性と2階導関数

Whenever the second derivative of a function f:ℝn→ℝ exists it is very easy to check whether f is convex. All we need to do is check whether the Hessian of f is positive semidefinite: ∇2f⪰0, i.e., denoting the Hessian matrix ∇2f by 𝐇, 𝐱⊤𝐇𝐱≥0 for all 𝐱∈ℝn. For instance, the function f(𝐱)=12∥𝐱∥2 is convex since ∇2f=𝟏, i.e., its Hessian is an identity matrix.
英語のヒント
関数f:ℝn→ℝの2階導関数が存在するときはいつでも、fが凸かどうかを確かめるのはとても簡単である。fのヘッセ行列が半正定値かどうか、つまり∇2f⪰0かどうかを確かめればよい。これは、ヘッセ行列∇2fを𝐇で表すと、すべての𝐱∈ℝnについて𝐱⊤𝐇𝐱≥0となることである。たとえば、関数f(𝐱)=12∥𝐱∥2は凸である。∇2f=𝟏、つまりそのヘッセ行列が単位行列だからである。
Formally, a twice-differentiable one-dimensional function f:ℝ→ℝ is convex if and only if its second derivative f″≥0. For any twice-differentiable multidimensional function f:ℝn→ℝ, it is convex if and only if its Hessian ∇2f⪰0.
英語のヒント
形式的には、2回微分可能な1次元の関数f:ℝ→ℝが凸であるのは、その2階導関数がf″≥0となるとき、かつそのときに限る。2回微分可能な任意の多次元の関数f:ℝn→ℝが凸であるのは、そのヘッセ行列が∇2f⪰0となるとき、かつそのときに限る。
First, we need to prove the one-dimensional case. To see that convexity of f implies f″≥0 we use the fact that
英語のヒント
まず、1次元の場合を証明する必要がある。fの凸性からf″≥0が導かれることを見るには、次の事実を使う。
12f(x+ϵ)+12f(x−ϵ)≥f(x+ϵ2+x−ϵ2)=f(x).(12.2.8)
Since the second derivative is given by the limit over finite differences it follows that
英語のヒント
2階導関数は有限差分の極限で与えられるので、次が導かれる。
f″(x)=limϵ→0f(x+ϵ)+f(x−ϵ)−2f(x)ϵ2≥0.(12.2.9)
To see that f″≥0 implies that f is convex we use the fact that f″≥0 implies that f′ is a monotonically nondecreasing function. Let a<x<b be three points in ℝ, where x=(1−λ)a+λb and λ∈(0,1). According to the mean value theorem, there exist α∈[a,x] and β∈[x,b] such that
英語のヒント
f″≥0からfが凸であることが導かれるのを見るには、f″≥0ならf′が単調非減少の関数であるという事実を使う。ℝの三つの点をa<x<bとし、x=(1−λ)a+λbかつλ∈(0,1)とする。平均値の定理により、次を満たすα∈[a,x]とβ∈[x,b]が存在する。
f′(α)=f(x)−f(a)x−a and f′(β)=f(b)−f(x)b−x.(12.2.10)
By monotonicity f′(β)≥f′(α), hence
英語のヒント
単調性によりf′(β)≥f′(α)なので、次が成り立つ。
x−ab−af(b)+b−xb−af(a)≥f(x).(12.2.11)
Since x=(1−λ)a+λb, we have
英語のヒント
x=(1−λ)a+λbなので、次が成り立つ。
λf(b)+(1−λ)f(a)≥f((1−λ)a+λb),(12.2.12)
thus proving convexity.
英語のヒント
こうして凸性が証明された。
Second, we need a lemma before proving the multidimensional case: f:ℝn→ℝ is convex if and only if for all 𝐱,𝐲∈ℝn
英語のヒント
第二に、多次元の場合を証明する前に、補題が一つ要る。f:ℝn→ℝが凸であるのは、すべての𝐱,𝐲∈ℝnについて、
g(z)=deff(z𝐱+(1−z)𝐲) where z∈[0,1](12.2.13)
is convex.
英語のヒント
が凸であるとき、かつそのときに限る。
To prove that convexity of f implies that g is convex, we can show that for all a,b,λ∈[0,1] (thus 0≤λa+(1−λ)b≤1)
英語のヒント
fの凸性からgが凸であることが導かれるのを証明するには、すべてのa,b,λ∈[0,1]について(したがって0≤λa+(1−λ)b≤1)次が成り立つことを示せばよい。
g(λa+(1−λ)b)=f((λa+(1−λ)b)𝐱+(1−λa−(1−λ)b)𝐲)=f(λ(a𝐱+(1−a)𝐲)+(1−λ)(b𝐱+(1−b)𝐲))≤λf(a𝐱+(1−a)𝐲)+(1−λ)f(b𝐱+(1−b)𝐲)=λg(a)+(1−λ)g(b).(12.2.14)
To prove the converse, we can show that for all λ∈[0,1]
英語のヒント
逆を証明するには、すべてのλ∈[0,1]について次が成り立つことを示せばよい。
f(λ𝐱+(1−λ)𝐲)=g(λ⋅1+(1−λ)⋅0)≤λg(1)+(1−λ)g(0)=λf(𝐱)+(1−λ)f(𝐲).(12.2.15)
Finally, using the lemma above and the result of the one-dimensional case, the multidimensional case can be proven as follows. A multidimensional function f:ℝn→ℝ is convex if and only if for all 𝐱,𝐲∈ℝn g(z)=deff(z𝐱+(1−z)𝐲), where z∈[0,1], is convex. According to the one-dimensional case, this holds if and only if g″=(𝐱−𝐲)⊤𝐇(𝐱−𝐲)≥0 (𝐇=def∇2f) for all 𝐱,𝐲∈ℝn, which is equivalent to 𝐇⪰0 per the definition of positive semidefinite matrices.
英語のヒント
最後に、上の補題と1次元の場合の結果を使うと、多次元の場合は次のように証明できる。多次元の関数f:ℝn→ℝが凸であるのは、すべての𝐱,𝐲∈ℝnについて、z∈[0,1]としたg(z)=deff(z𝐱+(1−z)𝐲)が凸であるとき、かつそのときに限る。1次元の場合により、これが成り立つのは、すべての𝐱,𝐲∈ℝnについてg″=(𝐱−𝐲)⊤𝐇(𝐱−𝐲)≥0(𝐇=def∇2f)となるとき、かつそのときに限る。これは、半正定値行列の定義により𝐇⪰0と同値である。