Randomized Block Kaczmarz Method with Projection for Solving Least Squares
Deanna Needell, Ran Zhao, Anastasios Zouzias
Introduction
The Kaczmarz method is a popular iterative solver of overdetermined systems of linear equations . Because of its simplicity and performance, the method and its derivatives are used in a range of applications from image reconstruction to digital signal processing . The method performs a series of orthogonal projections and iteratively converges to the solution of the system of equations. It is therefore computationally feasible even for very large and overdetermined systems.
Given a vector and an full rank (real or complex) matrix with rows , the algorithm begins with an initial estimate and cyclically projects the estimation onto each of the solution spaces. This process can be described as follows:
When the system is perturbed by noise or no longer consistent, , the randomized Kaczmarz method still provides expected linear convergence down to an error threshold ,
where denotes the th entry of . This result is sharp, and shows that the randomized Kaczmarz method converges with a radius proportional to the magnitude of the largest entry of the noise in the system. Since the iterates of the Kaczmarz method always lie in a single solution space, the method clearly will not converge to the least squares solution of an inconsistent system.
The bound (2) demonstrates that the randomized Kaczmarz method performs well when the noise in inconsistent systems is small. Zouzias and Freris introduced a variant of the method which utilizes a random projection to iteratively reduce the norm of the error . They show that the estimate of this Randomized Extended Kaczmarz (REK) method converges linearly in expectation to the least squares solution of the system, breaking the radius barrier of the standard method. The algorithm maintains not only an estimate to the solution but also an approximation to the projection of onto the range of :
where in iteration , and is the row and column of , respectively, each chosen randomly with probability proportional to their Euclidean norms. In this setting, we no longer require that the matrix be full rank, and ask for the least squares solution,
where denotes the Moore-Penrose pseudoinverse of . Zouzias and Freris showed that the REK method converges linearly in expectation to the least squares solution ,
where is the smallest non-zero singular value of and denotes its scaled condition number.
2 The block Kaczmarz method
Recently, Needell and Tropp analyzed a block version of the simple randomized Kaczmarz method . Like the traditional method, this version iteratively projects the current estimation onto the solution spaces. However, rather than using the solution space of a single equation, the block method projects onto the solution space of many equations simultaneously by selecting a block of rows rather than a single row. For a subset , denote by the submatrix of whose rows are indexed by . We again begin with an arbitrary guess for the solution of the system. Then for each iteration , select a block of rows. To obtain the next iterate, we project the current estimation onto the solution space of the equations listed in :
Here, the conditioning of the blocks plays a crucial row in the behavior of the method. Indeed, if each block is well-conditioned, its pseudoinverse can be applied efficiently using an iterative method such as CGLS . To guarantee such properties, Needell and Tropp utilize a paving of the matrix .
A row paving of a matrix is a partition of the rows such that
where again we denote by the submatrix of . We refer to the number as the size of the paving, and the numbers and are called the lower and upper paving bounds.
We refer to a row paving of as a column paving of . We thus seek pavings of with small number of blocks and upper paving constant . In the following, we will assume one has access to such a paving, and discuss in Section 3 how to construct such pavings for various types of matrices. When the matrix has unit-norm rows, equipped with such a row paving of , the main result of shows that the randomized block Kaczmarz algorithm (5) exhibits linear convergence in expectation:
where is an absolute constant and is the condition number of .
Since each iteration of the block method utilizes multiple rows, one can compare the rate of (6) and (1) by considering convergence per epoch (one cycle through the rows of ). From this analysis, one finds the bounds to be comparable. However, the block method can utilize fast matrix multiplies and efficient implementation, yielding dramatic improvements in computational time. See for details and empirical results.
3 Contribution
The REK method breaks the so-called convergence horizon of standard Kaczmarz method, allowing convergence to the least squares solution of inconsistent systems. The block Kaczmarz method on the other hand, allows for significant computational speedup and accelerated convergence to within a fixed radius of the least squares solution. The main contribution of this paper analyzes a randomized block Kaczmarz method which also incorporates a blocked projection step, which provides accelerated convergence to the least squares solution. In this case we need a column partition for the projection step and a row partition for the Kaczmarz step. Our results show that this method offers both linear convergence to the least squares solution when a row paving can be obtained, and improved convergence speed due to the blocking of both the rows and columns. In addition, we present a block coordinate descent variant which utilizes only a column paving and also yields linear convergence. We will see that the desired column paving may be obtained easily for arbitrary matrices, so this variant is especially useful when a good row paving cannot be obtained.
4 Organization
In Section 2 we begin by presenting the double block randomized Kaczmarz method which utilizes both a row and column paving, and provides the strongest theoretical results overall. We discuss methods for obtaining the desired matrix pavings in Section 3. Section 4 introduces the variant of the block and extended Kaczmarz methods that requires only a column paving of the matrix, readily accessible for arbitrary matrices. In Section 6 we present some experimental results for the various algorithms. We conclude with a discussion of related work and open directions in Section 7. The appendix includes proofs of intermediate results used along the way.
The Randomized Double Block Kaczmarz Method
It is natural to ask whether one can consider both a row partition and a column partition in the Kaczmarz method, blocking both in the Kaczmarz update step and the projection step. Indeed, utilizing blocking in both steps yields Algorithm 1 below. We thus propose the following randomized block extended Kaczmarz method using double partitioning. We will see later that since this method requires a row paving, it works very well when each of the row norms of the matrix are relatively similar (see Sections 3 and 5).
Combining the theoretical approaches in we will prove the following result about the convergence of Algorithm 1. This result utilizes both a column paving and row paving.
where and .
Proof. We begin with the following lemma which is motivated by Lemma of , and shows that the iterates converge linearly to the projection of onto the kernel of .
Let be a fixed vector and be a column paving of . Assuming the notation of Theorem 1, for every it holds that
where .
Proof. Let and notice . Define for . Then,
where the first equality follows by the definition of , the second by orthogonality between the range of and , and the final equality by definition of . Next, we prove that
where the first equality follows since , the second equality from the unitary invariance property of the Euclidean norm, the third equality by replacing with , the next three lines follow since and by the paving assumption, and the final inequality follows since for all (indeed, and it follows that for every by the recursive definition of ). It follows that
Repeat the above inequality times and notice that to conclude.
Next, Lemma 2.2 of shows that for any vector ,
Since the range of and are orthogonal, we have
where for shorthand we will write to mean . Combining (9) with along with (10), we have
To apply this bound recursively, we will utilize an elementary lemma. It is essentially proved in [53, Theorem 8] but for completeness we recall its proof in the appendix.
Suppose that for some , the following bounds hold for all :
In Section 3 we will see that matrix row-pavings for standardized matrices, those whose rows have unit norm, can be obtained readily. One can thus use the column-normalized version of the matrix in line 5 of Algorithm 1 and the corresponding column paving. Note that one need not have access to the complete column-standardized matrix, instead the columns of the submatrix in line 5 could be normalized on the fly. See Section 3 for more on obtaining row pavings and further details.
2 Comparison of Convergence Rates
The bound of Theorem 1 improves upon that of the randomized block Kaczmarz method because it demonstrates linear convergence to the least squares solution , whereas (6) shows convergence only within a radius proportional to , which we call the convergence horizon. Algorithm 1 is able to break this barrier because it iteratively removes the component of which is orthogonal to the range of . This of course is also true of the randomized Extended Kaczmarz method (3) as it also breaks this horizon barrier. To compare the rate of (4) to that of Theorem 5, we consider two important scenarios.
First, consider the case when is nearly square, and each submatrix can be applied efficiently via a fast multiply. In this case, each iteration of Algorithm 1 incurs approximately the same computational cost as an iteration of the REK method. Thus, we may directly compare the convergence rates of Theorem 5 and (4) to find that Algorithm 1 is about times faster than REK in this setting. Thus when is much larger than , this can result in a significant speedup.
Alternatively, if the matrix does not admit a fast multiply, it is fair to only compare the convergence rate per epoch, since each iteration of Algorithm 1 may require more computational cost than those of REK. Since an epoch of Algorithm 1 and REK consist of and iterations, respectively, we see that the rate of the former is proportional to whereas that of REK is proportional to . We see in this case that these bounds suggest REK exhibits faster convergence (assuming ). However, as observed in the randomized Block Kaczmarz method, the block methods still display faster convergence than their single counterparts because of implicit computational issues in the linear algebraic subroutines. See the discussion in and the experimental results below for further details.
Obtaining matrix pavings
We devote this section to a brief discussion about matrix pavings and how they may be obtained to utilize the results of Theorem 1. The results discussed here on matrix pavings stem from subset selection, the problem of selecting a large submatrix with desired geoemtric properties, whose origins come from the well-known Restricted Invertibility Principle of Bourgain Tzafriri . The literature now contains several results on subset selection, see e.g. and for recent advancements. We summarize here a few results useful for our purposes.
The simplest type of matrix to first consider is one which has unit-norm rows, which we call row-standardized (and a matrix with unit-norm columns is column-standardized). A surprising result shows that every row-standardized matrix admits a row paving with well-controlled paving parameters. Tropp proves the following result in [45, Thm. 1.2], whose origins are due to Bourgain and Tzafriri and Vershynin .
Fix a number and row-standardized matrix with rows. Then admits a row paving with
Proposition 4 shows the existence of such a paving, but the literature provides various efficient mechanisms for the construction of good pavings as well. In many cases one constructs such a paving simply by choosing a partition of an appropriate size at random, see for an efficient method to compute a paving satisfying (13). See also and the references therein for a thorough discussion of these types of results.
If the matrix is row-standardized, one can thus construct a row paving satisfying (13). If the matrix also naturally admits a column paving (for example if it is symmetric or positive semi-definite), then both pavings will have such bounded parameters. If the latter does not hold, one can instead utilize the column-standardized version of , which we denote , in line 5 of Algorithm 1. The standardization can either be done on the fly during the algorithm, or ahead of time. Either way, Proposition 4 can be combined with Theorem 1 to yeild the following corollary.
where , and and denote the condition numbers of and , respectively.
If the matrix is not row-standardized, one can run Algorithm 1 on the standardized system, along with a paving guaranteed by Proposition 4. Clearly, the method will converge to the new least squares solution, which does not necessarily coincide with the original least squares solution in the inconsistent case.
If one uses this same paving for , one has (quite pessimistically) that the corresponding paving parameters , , and for satisfy
One can then directly apply Theorem 1 with this paving to obtain an analogous version of Corollary 5 for arbitrary matrices, which shows that
where now where we have written to denote the dynamic range of the row norms of (and remains the same as in the corollary). This demonstrates that if the dynamic range is bounded, the convergence rate is the same as in the standardized case, up to constants. In either case, these results demonstrate linear convergence to the true least squares solution.
An alternative to these types of bounds can be obtained by simply only using a column paving for the matrix. As we elaborate below, the least squares solution can still be obtained from the column-normalized system. Since column-pavings can be easily attained in this case via Proposition 4, such a method offers a nice alternative in situations where the dynamic range of the row norms is unknown or unbounded. We propose such a method in the next section.
A Randomized Block Coordinate Descent Method
We next present a simple variant of the extended Kaczmarz method which utilizes only a column paving of the matrix. For that reason, one need not worry about whether the matrix is row-standardized. Moreover, the column-standardized version can be used within the algorithm which guarantees bounded paving parameters, while still finding the true least squares solution.
Utilizing the benefits of both the block variant and the randomized extension, we propose the following randomized block coordinate descent method for the inconsistent case.
We may utilize some of the previous analysis to prove convergence of Algorithm 2. Observe that Step 6 of Algorithm 1 is identical to Steps 5 and 7 of Algorithm 2, therefore Lemma 2 implies that
To utilize this result, we aim to relate the iterates to the estimation . The following claim quantifies precisely this relation.
For every , at the end of the -th iteration, it holds that .
Combining this lemma with (15) yields the following result which shows convergence of the estimation to the least squares solution under the map .
where the first equality follows by , the second by orthogonality and the last equality from Lemma 6. Combined with inequality (7) this yields the desired result.
When has full column rank, we may bound the estimation error by which combined with the fact that implies the following corollary.
2 Implementation
The advantage to a single paving approach as in Algorithm 2 is that one can utilize the column-standardized version of while maintaining the same convergence to the (scaled version of the) least squares solution. Utilizing Proposition 4, one is guaranteed a column-paving satisfying (13), so that paving parameters of Theorem 7 and Corollary 8 are bounded. Since re-normalizing the columns of the matrix only re-scales the entries of , Theorem 7 and Corollary 8 grant one access to the original least squares solution . To be precise, now let be the diagonal matrix whose entries correspond to the reciprocals of the column norms of , so that has unit-norm columns. Let denote the least squares solution of the re-normalized system, so that one has . Then
Thus applying Theorem 7 for , and utilizing the fact that the range of is the same as that of , one has
This then implies that when the matrix is full rank,
Since and are the paving parameters of , one has by utilizing Proposition 4 and substituting the bounds of (13) into (17) that
Although this bound does depend on the conditioning of both and (note the rate itself only depends on the conditioning of the latter), it is the first to guarantee linear convergence to the true least squares solution utilizing a paving which is guaranteed by Proposition 4 while not placing any restrictions on the matrix itself (such as standardization).
In considering the improvements offered by both the REK method and the block Kaczmarz method, one may ask whether it is advantageous to run a traditional REK projection step as in (3) along with a traditional block Kaczmarz update step as in (5). However, empirically we have observed that such a combination actually leads to a degradation in performance and requires far more epochs to converge than the algorithms discussed above. We conjecture that it is important to run both the projection update and the Kaczmarz update “at the same speed”; if the Kaczmarz update utilizes many rows at once, so should the projection update, and vice versa.
Summary of Approaches
Here we detail the various approaches proposed, and summarize the practical implementation in several frameworks. Since the block variants of the methods require the blocks be well conditioned, it is natural to rely on matrix pavings for the analysis. Unfortunately, such pavings are only readily available when the matrix itself is properly normalized. For that reason, we have proposed several practical alternatives for the important setting in which normalization is not feasible. Both of our proposed methods still offer computational advantages over the standard approaches (see the next section). We summarize these approaches here, which cover all possible settings.
When the system is consistent, one does not lose any convergence properties by re-scaling the system to be standardized, since the solution remains the same. In this simple setting, one can utilize the standardized system (either standardizing a priori or on the fly), and benefit from the convergence guaranteed by Corollary 5.
When the matrix is already standardized (as naturally occurs for example in Vandermonde matrices used in trigonometric approximation), as in the above case one can immediately utilize Corollary 5 to guarantee convergence to the least squares solution.
If the system is not standardized, but the ratio of the largest to smallest row norm is bounded (as is the case in random matrices for example, which have tightly concentrated row norms), one can still utilize this result. Indeed, by utilizing the same paving one would use if the matrix was actually standardized – but not actually standardizing the system, Corollary 5 can be used to obtain the convergence rate given in (14). One sees that if the dynamic range is bounded (by say, a constant or even ), the method convergences to the original least squares solution with approximately the same convergence rate.
If the matrix has a large variety of row norms, it may clearly be challenging to guarantee the desired row paving. For that reason, it will be advantageous to use a column paving. To that end, we propose Algorithm 2 which is designed for systems that cannot be separated into well-conditioned row blocks. As discussed in Section 4.2, Theorem 7 can be used via the column-standardized paving to obtain the convergence rate given in (18). This bound guarantees linear convergence to the true least squares solution, even for matrices which are far from standardized. The disadvantage of course is that the rate depends on the conditioning of the column-standardized version, which may be hard to explicitly bound (as is true for general large matrices anyway).
In any of these cases, our results may be used to guarantee linear convergence in expectation to the true least squares solution of the system. Moreover, because matrix blocks can be utilized, we often see a significant speedup in runtime due to practical considerations. See the next section for examples of such behavior.
Experimental Results
Here we present some experiments using simple examples to illustrate the benefits of block methods. We do not claim optimized implementations of the method, and only run on small problem sizes; our purpose is only to demonstrate that even in these simple examples, the block method offers advantages to the standard method. We refer the reader to for more empirical results for both REK and block methods.
Lastly, we tested the methods on tomography problems, generated using the Matlab Regularization Toolbox by P.C. Hansen (http://www.imm.dtu.dk/~pcha/Regutools/) . In particular we present a 2D tomography problem for an matrix with and . Here corresponds to the absorption along a random line through an grid. In our experiments we set and the oversampling factor . This yielded a matrix with condition number . Since for this matrix it may be difficult to obtain a row paving, we instead use Algorithm 2 and obtain a random column paving from the standardized version and use that for the matrix . The results for various choices of paving size are displayed in Figure 5, which are in line with previous experiments.
Related Work and Discussion
The Kaczmarz method was first introduced in the 1937 work of Kaczmarz himself . Since then, the method has been revitalized by researchers in computer tomography, under the name Algebraic Reconstruction Technique (ART) . Deterministic convergence results for the method often depend on properties of the matrix that are difficult to compute or analyze . Moreover, it has been well observed that random choice of row selection often speeds up the convergence .
Recently, Strohmer and Vershynin derived the first provable convergence rate of the Kaczmarz method, showing that when each row is selected with probability proportional to its norm the method exhibits the expected linear convergence of (1). This work was extended to the inconsistent case in , which shows linear convergence to within some fixed radius of the least squares solution. The almost-sure guarantees were recently derived by Chen and Powell . To break the convergence barrier, relaxation parameters can be introduced, so that each iterate is over or under projected onto each solution space. Whitney and Meany prove that if the relaxation parameters tend to zero that the iterates converge to the least squares solution . Further results using relaxation have also been obtained, see for example . An alternative to relaxation parameters was recently proposed by Zouzias and Freris as the REK method described by (3). Rather than alter the projection step, motivated by ideas of Popa they introduce a secondary step which aims to reduce the residual.
The Kaczmarz method has been extended beyond linear systems as well. For example, Leventhal and Lewis analyze the method for systems with polyhedral constraints and inequalities, which was also extended to the block case , and Richtárik and Takávc build on these results for general optimization problems.
Another important aspect of research in this area focuses on accelerating the convergence of the methods. Geometric brute force methods can be used , additional row directions may be added , or instead one can select blocks of rows rather than a single row in each iteration. The block version of the Kaczmarz method is originally due to work of Elfving and Eggermont et al. . Its convergence rates were recently studied in and analyzed via pavings by Needell and Tropp . The block Kaczmarz method is of course a special instance in a broader class of block projection algorithms, see for example for a more general analysis and for a presentation of other block variants.
To use block methods effectively, one needs to obtain a suitable partition of the rows (and/or columns). Popa constructs such partitions by creating orthogonal blocks , whereas Needell and Tropp promote the use of row pavings to construct the partition .
Construction of pavings has been studied for quite some time now, and most early results rely on random selection. The guarantee of lower and upper paving bounds has been derived by Bourgain and Tzafriri and Kashin and Tzafriri , respectively. Simultaneous guarantees were later derived by Bourgain and Tzafriri with suboptimal dependence on the matrix norm. Recently, Spielman and Srivastava and Youssef provided simple proofs of the results from and , respectively. Vershynin and Srivastava extend the paving results to general matrices with arbitrary row norms; see also . Proposition 4 follows from the work of Vershynin and Tropp , and is attributed to the seminal work of Bourgain and Tzafriri . For particular classes of matrices, the paving can even be obtained from a random partition of the rows with high probability. This is proved by Tropp using ideas from , and is refined in .
Acknowledgments
D.N. is thankful to the Simons Foundation Collaboration grant and the Alfred P. Sloan Fellowship. A.Z. has received funding from the European Research Council under the European Union’s Seventh Framework Program (FP7/2007-2013) / ERC grant agreement 259569. We would also like to thank Anna Ma for thoughtful discussions, and the reviewers for useful comments which significantly improved the manuscript.
Appendix A Proof of intermediate results
Assume the bounds (12) hold. Applying the first bound in (12) recursively yields
where the second inequality holds by the assumption that , and the last by the properties of the geometric summation. Similarly, observe that for any and we have
Now we choose and such that and if is even, or if is odd. Combining the two inequalities above, we have