A note on overrelaxation in the Sinkhorn algorithm
Abstract
EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.
Full text
Lehmann, Tobias; von Renesse, Max-K.; Sambale, Alexander; Uschmajew, André Article — Published Version A note on overrelaxation in the Sinkhorn algorithm Optimization Letters Provided in Cooperation with: Springer Nature Suggested Citation: Lehmann, Tobias; von Renesse, Max-K.; Sambale, Alexander; Uschmajew, André (2021) : A note on overrelaxation in the Sinkhorn algorithm, Optimization Letters, ISSN 1862-4480, Springer, Berlin, Heidelberg, Vol. 16, Iss. 8, pp. 2209-2220, https://doi.org/10.1007/s11590-021-01830-0 This Version is available at: https://hdl.handle.net/10419/287082 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. https://creativecommons.org/licenses/by/4.0/
Optimization Letters (2022) 16:2209–2220 https://doi.org/10.1007/s11590-021-01830-0 ORIGINAL PAPER A note on overrelaxation in the Sinkhorn algorithm Tobias Lehmann1·Max-K. von Renesse1·Alexander Sambale1· André Uschmajew2 Received: 20 February 2021 / Accepted: 3 November 2021 / Published online: 14 December 2021 © The Author(s) 2021 Abstract We derive an a priori parameter range for overrelaxation of the Sinkhorn algorithm, which guarantees global convergence and a strictly faster asymptotic local convergence. Guided by the spectral analysis of the linearized problem we pursue a zero cost procedure to choose a near optimal relaxation parameter. Keywords Sinkhorn algorithm ·Matrix scaling ·Overrelaxation ·Optimal transport 1 Introduction and statement of result The Sinkhorn algorithm is the benchmark approach to fast computation of the entropic regularization of optimal transportation [1]. Ultimately, one is faced with the following numerical problem: Given two probability vectors a∈Rm +,b∈Rn +and a matrix K∈Rm×n +, the goal is to find a pair of vectors (u,v)∈Rm +×Rn +such that u◦Kv=aand v◦KTu=b,(1) where x◦ydenotes the componentwise multiplication (Hadamard product) of vectors of equal dimension. Here R+refers to the positive reals. We assume min(m,n)≥2. In the standard Sinkhorn algorithm an approximating sequence (u,v )starting from an initial vector v0∈Rn +is constructed via the update rule u+1=a Kv ,v +1=b KTu+1 , BAndré Uschmajew uschmaje[email protected] Max-K. von Renesse [email protected] 1Universität Leipzig, Fakultät für Mathematik und Informatik, Augustusplatz 10, 04109 Leipzig, Germany 2Max Planck Institute for Mathematics in the Sciences, 04103 Leipzig, Germany 123
2210 T. Lehmann et al. where x ydenotes the componentwise division of vectors of equal dimension. It is a classic result by Sinkhorn [2] that for any initial point v0∈Rn +the algorithm converges to a solution (u∗,v∗)of (1), which is unique modulo rescaling (tu∗,t−1v∗),t>0. Moreover, the convergence, e.g. of suitably normalized iterates u/uand v/v, or using other equivalent distance measures like the Hilbert metric, is R-linear with an asymptotic rate at least (K)2, where (K)<1 is the Birkhoff contraction ratio defined in (8) further below [3]. See also [4] for an overview. In this note we discuss a modified version of the Sinkhorn algorithm employing relaxation, which was recently proposed in [5,6]. It uses the update rule u+1=u1−ω ◦a Kvω ,v +1=v1−ω ◦b KTu+1ω ,(2) where ω>0 is are suitably chosen relaxation parameter, and exponentiation is understood componentwise. In a log-domain formulation such as (7) further below, the relation to the classic concept of relaxation in (nonlinear) fixed point iterations will become immediately apparent. Note that the iteration (2) still has the solution of (1)as its unique (modulo scaling) fixed point. As illustrated in [5,6], choosing the parameter ωlarger than one can significantly accelerate the convergence speed compared to the standard Sinkhorn method, which sometimes can be slow. For optimal transport, such an improvement could be in particular relevant in the regime of small regularization, or when a high target precision is needed, such as in applications in density functional theory [7]. While global convergence for ω= 1 is not obvious anymore, local convergence of the modified method is ensured for all 0 <ω<2, and the asymptotically optimal relaxation parameter can be determined from its linearization at a fixed point (u∗,v ∗). In logarithmic coordinates, the linearization of the standard Sinkhorn method has the iteration matrix M=diag 1 aP∗diag 1 bPT ∗,where P∗=diag(u∗)Kdiag(v∗). (3) The local convergence rate equals the second largest eigenvalue 0≤ϑ2<1 of that matrix; see [8]. Note that Mhas real and nonnegative eigenvalues since it is similar to a positive semidefinite matrix, and its largest eigenvalue equals one (the eigenvector having constant entries), which accounts for the scaling indeterminacy in the problem formulation. For the modified method with relaxation, the local rate is also related to ϑ2, which has been worked out in [5] and is summarized in the following theorem. For convenience, we provide a brief outline how this result can be obtained at the end of Sect. 2. Theorem 1 (cf. [5]) Assume ϑ2>0. For all choices of 0<ω<2the modified Sinkhorn algorithm (2)is locally convergent in some neighborhood of (u∗,v∗).Its 123
A note on overrelaxation in the Sinkhorn algorithm 2211 asymptotic (R-linear) convergence rate is ρϑ(ω) := ⎧ ⎨ ⎩ 1 4ωϑ +ω2ϑ2−4(ω −1)2 ,if 0<ω≤ωopt, ω−1,if ωopt ≤ω<2, (4) where ωopt =2 1+√1−ϑ2>1.(5) It holds ρϑ(ω) < 1for all 0<ω<2, and ωopt provides the minimal possible rate (independent of the starting point) on that interval, namely ρopt =ωopt −1=1−√1−ϑ2 1+√1−ϑ2<ϑ 2. By the above theorem, the optimal relaxation parameter ωopt is always larger than one (if ϑ2>0). In fact, by the exact formula (4) for the convergence rate, the range of ωfor which the modified method is asymptotically strictly faster than the standard Sinkhorn method, that is, ρϑ(ω) < ϑ2=ρϑ(1), is precisely the interval 1<ω<1+ϑ2.(6) However, the value of ϑ2depends on the solution and is therefore not known in advance. To deal with this problem, an adaptive procedure for choosing ωis proposed in [5]. As our contribution, the main goal in this note is to provide an a priori interval for the relaxation parameter ωfor which the modified iteration is both globally convergent and locally faster than the standard Sinkhorn method. In Theorem 3we first prove global convergence of the modified method for parameters in the interval 0 <ω< 2 1+(K). In Theorem 4we then provide an a priori lower bound ϑ2≥δK,a,b>0, which depends only on the data of the problem, but requires a full rank assumption on K. By (6), any ω∈(1,1+δK,a,b)then satisfies ρϑ(ω) < ϑ2. Taken together this yields the following result. Theorem 2 Assume rank(K)=min(m,n)≥2. For any 1<ω<1+ϑ2the asymptotic local convergence rate of the modified Sinkhorn method (2)is faster than for the standard Sinkhorn method. For 1<ω<min 1+δK,a,b,2 1+(K)the modified method is both globally convergent and asymptotically faster than the standard method. We remark that our derived a priori interval for ωis usually very small, and hence our result is of rather theoretical interest. In the relevant cases, when ϑ2is close to one, significant acceleration is achieved only when ωis close to ωopt (which tends to two for ϑ2→1). A possible heuristic to select a nearly optimal relaxation is to approximate the second largest eigenvalue of Mbased on the current iterate. After a 123
2212 T. Lehmann et al. similarity transform, this requires to compute the spectral norm of a symmetric matrix. An even simpler approach, as suggested in [5], is to directly estimate ϑ2, and hence ωopt, by monitoring the convergence rate of the standard Sinkhorn method in terms of a suitable residual. In the final Sect. 4we include numerical illustrations, which indicate that in certain cases such heuristics can be quite precise already in the initial phase of the algorithm, resulting in the almost optimal convergence rate at almost no additional cost. This confirms that overrelaxation is a simple way to significantly accelerate the Sinkhorn method in cases where it is slow. For completeness, we should mention that alternative approaches for solving problem (1) and aiming at fast convergence have been proposed based on Newton’s method, see, e.g., [9,10] and references therein. The convergence analysis of the Sinkhorn method is usually carried out in a logdomain formulation [4]. We choose the closely related framework of compositional data space used, e.g., in statistics [11], which we think could be of independent interest in this context. In this space, which is introduced in the next section, the Sinkhorn algorithm with a positive matrix Kreads as a nonlinear fixed point iteration for an essentially contractive iteration function, as is known from the Birkhoff–Hopf theorem. The main results are then presented in Sect. 3. Let us note that the assumption that Khas strictly positive entries is not essential for all of the results. While global convergence of the standard Sinkhorn method to a unique (up to scaling) positive solution (u,v)of (1) can be shown under several weaker assumptions, most notably when a=b=1and Kis square, nonnegative and has total support [12], we require the global contractivity of the process in Hilbert metric (which holds for positive K) in our proof that global convergence can still be ensured for some ω>1 (Theorem 3). The idea of accelerating convergence by overrelaxation, on the other hand, is very general and the local spectral analysis provided by Theorem 1applies whenever the iteration (2) is locally well defined around a (positive) fixed point (u∗,v∗)and ϑ2<1. Correspondingly, Theorem 4on a lower bound for ϑ2does not require Kto be positive. Hence one has guaranteed acceleration of local convergence for 1 <ω<1+δK,a,b in several scenarios where Kis only nonnegative. 2 Formulation in compositional data space The problem (1) as well as the Sinkhorn algorithm and its modified variant inherit a natural scaling indeterminacy of the variables uand v. It can be therefore formulated in a suitable equivalence space. Here we recast the algorithm in the framework of what is called compositional data space; see, e.g., [11,13]. To this aim, let Cm:= Rm +/∼, where x∼x:⇐⇒ ∃t>0:x=tx. 123
A note on overrelaxation in the Sinkhorn algorithm 2213 The resulting equivalence class of xwill be denoted by x. One specifies a vector addition and a scalar multiplication on Cmvia x+y:= x◦y,γ·x:= xγ,γ∈R, where xγhas the components (xγ 1,...,xγ n).Asaresult(Cm,+,·)becomes a real vector space of dimension m−1. In this space we consider the so called Hilbert norm xH:= log max i,j xi xj , turning (Cm,+,·,·H)into a finite dimensional Banach space. Note that this norm on the equivalence classes coincides with the well-known Hilbert distance on the representatives: dH(x,y)=x−yH. Similarly we construct a Banach space Cn=Rn +/∼. The modified Sinkhorn algorithm (2) can be interpreted as an iteration in the space Cm×Cnand reads u+1=(1−ω) ·u+ω·a−ω·K(v), v+1=(1−ω) ·v+ω·b−ω·KT(u+1), (7) where K:Cn→Cmand KT:Cm→Cnare now the nonlinear maps given by K(v)=Kv, KT(u)=KTu. The convergence of the standard Sinkhorn algorithm (ω=1) is based on a famous result of Birkhoff and Hopf on the contractivity of Kand KT. To state it, define the quantities η(K):= max i,j,k, KikKj KjkKi and (K):= √η(K)−1 √η(K)+1.(8) Then the following holds; for a proof, see, e.g., [14, Theorems 3.5 & 6.2]. Theorem (Birkhoff–Hopf) For any K ∈Rm×n +and v,v∈Rn +let (K)be defined as above. Then sup v,v∈Rm + dH(Kv, Kv) dH(v, v)=(K). Note that (K)=(KT)<1. As a result, both Kand KTare contractive maps in the Hilbert norm with Lipschitz constant (K), which is also called the Birkhoff contraction ratio of K. Based on this, it is not difficult to establish the global convergence of the standard Sinkhorn algorithm in the space Cm×Cnat a rate O((K)2). 123
2214 T. Lehmann et al. It is important to emphasize that studying the convergence in Cm×Cn, that is, convergence of equivalence classes, is sufficient for understanding the method in Rm +×Rn +. Indeed, a pair (u∗,v∗)is a fixed point of (7) if and only if for any choice of representatives (u∗,v∗)there exist λ, μ such that λu◦Kv=aand μv ◦KTu=b. From 1T ma=1T nb(here 1denotes a vector of all ones) it follows that λ=μ, and hence, e.g. u+:= λ−1/2u∗and v+:= λ−1/2v∗solve the initial problem (1), where λ=uTKv. Moreover, choosing representatives (u,v )of the iterates (u,v)such that 1T mu=1T nv=1, and setting u+ := λ−1 2 u,v+ := λ−1 2 vwith λ=uT Kv, yields a sequence which converges exponentially fast to (u∗,v∗). We now briefly outline how the local convergence analysis for (7) can be conducted [5], leading to Theorem 1. By combining both steps of the iteration (7)intoa nonlinear fixed point iteration (u+1,v+1)=F(u,v)in the space Cm×Cn, one finds that its derivative at the fixed point (u∗,v∗)takes the form Mω:= (Im+n−ω·L)−1[(1−ω) ·Im+n+ω·U],(9) where L=00 −K T(u∗)0,U=0−K(v∗) 00 . Matrices of the form Mωare well known as error iteration matrices of block SOR methods for linear systems. The spectral radius of Mωcan be computed exactly from formula (4), if the spectral radius ϑof L+Uis known; see [15, Sec. 6.2] or [16, Thm. 4.27]. The eigenvalues of L+U, however, are square roots of the eigenvalues of the composition of derivatives K(v∗)K T(u∗), which is a linear map on Cm. It remains to show that the largest eigenvalue of that operator is precisely the second largest eigenvalue of the matrix Min (3). Indeed, by elementary calculations, Mis the matrix representation of K(v∗)K T(u∗)under the isomorphism u→ exp(u)between the subspace {u∈Rm:1T mu=0}⊆Rmand Cm. 3 Main results We prove the global convergence of the modified method for a range of values ωlarger than one. Theorem 3 Let =(K)be the Birkhoff contraction ratio of K. For 0<ω< 2 1+, the modified Sinkhorn algorithm (7)converges, for any starting point, to (u∗,v∗) exponentially fast. 123
A note on overrelaxation in the Sinkhorn algorithm 2215 Proof Starting from (7), using the triangle inequality and the contractivity of Kand KTprovided by the Birkhoff-Hopf theorem, we obtain u+1−u∗H≤|1−ω|u−u∗H+ω v−v∗H, v+1−v∗H≤|1−ω|v−v∗H+ω u+1−u∗H ≤|1−ω|+(ω)2v−v∗H+ω|1−ω|u−u∗H. As a consequence, for u:= u+1−u∗Hand v:= v+1−v∗Hwe obtain u+1 v+1≤Tωu v,where Tω=|1−ω|ω ω|1−ω||1−ω|+(ω)2, and the vector inequality is understood entry-wise. Since all involved quantities are non-negative the inequality can be iterated, which gives u+1 v+1≤(Tω)+1u0 v0. Hence, to prove exponential convergence it suffices to show that the spectral radius of Tωis strictly less than one. Since the spectral radius equals |1−ω|+(ω)2 2+ (ω)4 4+(ω)2|1−ω|, this is the case if and only if 0 <ω<2/(1+). Next we provide a lower bound for the second largest eigenvalue ϑ2of the matrix Min (3), which by (6) then yields an interval for ωsuch that the modified method has a strictly faster asymptotic convergence rate than the standard Sinkhorn method. Theorem 4 Let rank(K)=min(m,n)≥2and δ1=amin bmax ·1−bmax K∞ σmin(K)2−amin >0,δ 2=bmin amax ·1−amax KT∞ σmin(K)2−bmin >0, where σmin(K)is the smallest positive singular value of K , K∞=maxv∞=1 Kv∞, and the subscripts min,max denote the smallest and largest entry of the corresponding vector. Then it holds ϑ2≥δK,a,b:= ⎧ ⎪ ⎨ ⎪ ⎩ δ1if m >n, δ2if m <n, max(δ1,δ 2)if m =n. Note that for a positive matrix K∞>σ min(K). Moreover, amin ≤1 m≤1 n≤ bmax <1ifm≥n, and vice versa if m≤n. Hence δK,a,bis indeed smaller than one, which is in line with the bound ϑ2≤(K)2. 123
2216 T. Lehmann et al. Proof We consider the case m≥n. Instead of matrix Mwe consider the positive semidefinite matrix H=diag u∗ a1/2Kdiag v∗◦v∗ bKTdiag u∗ a1/2∈Rm×m, which is obtained from Mby a similarity transformation (and using (1)). Since the dominant eigenvector of H(with eigenvalue one) is a1/2,wehave ϑ2=max w, Hw w, w:w, a1/2=0. By projecting on the orthogonal complement of a1/2, and noting that a1/22=1, we first rewrite this as ϑ2=max w, Hw−w, a1/22 w, w−w, a1/22, where the maximum is taken over all wthat are not collinear to a1/2. For such wthe numerator is always nonnegative and the denominator is positive. Next we substitute w=a−1/2◦Kv∗◦z with a new variable z. This yields ϑ2=max KTz,v∗◦v∗ b◦KTz−KTz,v∗2 z,Kv∗◦Kv∗ a◦z−KTz,v∗2, where the maximum is taken over all znot collinear with u∗(the numerator is then nonnegative and the denominator is positive). To obtain a lower bound, we now evaluate the expression at zsatisfying KTz=ej where ejdenotes the j-th unit vector. Note that such zexists (KThas full row rank) and is indeed not collinear to u∗, since otherwise KTu∗would be collinear with ej, which contradicts KTu∗◦v∗=b. Therefore, using this z, we get ϑ2≥1 bmax −1(v∗)2 j z,Kv∗◦Kv∗ a◦z−(v∗)2 j . We can choose jas the position of a largest entry of the vector v∗. Then in the denominator z,Kv∗◦Kv∗ a◦z≤max i (Kv∗)2 i aiz2≤K2 ∞(v∗)2 j amin 1 σmin(K)2. 123