[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ Skip to content
Licensed Unlicensed Requires Authentication Published by De Gruyter August 22, 2023

Pass-efficient randomized LU algorithms for computing low-rank matrix approximation

  • Bolong Zhang and Michael Mascagni EMAIL logo

Abstract

Low-rank matrix approximation is extremely useful in the analysis of data that arises in scientific computing, engineering applications, and data science. However, as data sizes grow, traditional low-rank matrix approximation methods, such as singular value decomposition (SVD) and column pivoting QR decomposition (CPQR), are either prohibitively expensive or cannot provide sufficiently accurate results. A solution is to use randomized low-rank matrix approximation methods such as randomized SVD, and randomized LU decomposition on extremely large data sets. In this paper, we focus on the randomized LU decomposition method. Then we propose a novel randomized LU algorithm, called SubspaceLU, for the fixed low-rank approximation problem. SubspaceLU is based on the sketch of the co-range of input matrices and allows for an arbitrary number of passes of the input matrix, v 2 . Numerical experiments on CPU show that our proposed SubspaceLU is generally faster than the existing randomized LU decomposition, while remaining accurate. Experiments on GPU shows that our proposed SubspaceLU can gain more speedup than the existing randomized LU decomposition. We also propose a version of SubspaceLU, called SubspaceLU_FP, for the fixed precision low-rank matrix approximation problem. SubspaceLU_FP is a post-processing step based on an efficient blocked adaptive rank determination Algorithm 5 proposed in this paper. We present numerical experiments that show that SubspaceLU_FP can achieve close results to SVD but faster in speed. We finally propose a single-pass algorithm based on LU factorization. Tests show that the accuracy of our single-pass algorithm is comparable with the existing single-pass algorithms.

MSC 2020: 65F99; 65C99

A Linear algebra basics

We briefly review the definitions and properties of the orthogonal projection and the pseudoinverse [10].

Orthogonal projection

An orthogonal projection is a linear transformation from a vector space to itself. For a matrix 𝐀 m × n , we use Range ( 𝐀 ) to denote the space spanned by the columns of 𝐀 . Suppose 𝐀 has full column rank. Then we denote the orthogonal projection of Range ( 𝐀 ) as 𝐏 𝐀 , which is defined as follows:

𝐏 𝐀 = 𝐀 ( 𝐀 T 𝐀 ) - 1 𝐀 T .

It is easy to prove the following proprieties for 𝐏 𝐀 :

  1. 𝐏 𝐀 2 = 𝐏 𝐀 ,

  2. Range ( 𝐀 ) = Range ( 𝐏 𝐀 ) ,

  3. 𝐏 𝐀 = 𝐀𝐀 T , if 𝐀 has orthonormal columns.

Pseudoinverse

In linear algebra, the pseudoinverse of a matrix 𝐀 m × n is the generalization of the inverse for non-square matrices. It is customary to denote the pseudoinverse of 𝐀 m × n with a dagger, 𝐀 . If m n and 𝐀 m × n has full column rank, then the pseudoinverse of 𝐀 m × n can be computed as

(A.1) 𝐀 = ( 𝐀 T 𝐀 ) - 1 𝐀 T ,

where 𝐀 n × m . 𝐀 n × m has the following properties:

  1. ( 𝐀 ) T = ( 𝐀 T ) .

  2. If 𝐀 m × n has full column rank, then 𝐏 A = 𝐀𝐀 is an orthogonal projection.

B SVD for low-rank approximation problem

Suppose the SVD decomposition for matrix 𝐀 m × n , m n is the following:

(B.1) 𝐀 = 𝐔 𝚺 𝐕 T ,

where 𝐔 m × n has orthonormal columns, 𝐕 n × n is an orthogonal matrix, and 𝚺 n × n is a diagonal matrix whose diagonal entries are the singular values of 𝐀 in descending order. Then the optimal solution to the fixed rank problem (1.1) for a given rank k is 𝐀 k = 𝐁𝐂 , where we set 𝐁 = 𝐔 ( : , 1 : k ) 𝚺 ( 1 : k , 1 : k ) and 𝐂 = 𝐕 ( : , 1 : k ) T .[3] This gives us the explicit matrix norms of our rank k approximation errors as

𝐀 - 𝐀 k 2 = σ k + 1 and 𝐀 - 𝐀 k F = i = k + 1 n σ i 2 .

C Randomized SVD Algorithm

Formally, for a given matrix 𝐀 m × n , we multiply it with a random Gaussian matrix 𝛀 n × l , where l = k + q , k is the target rank and q is the oversampling parameter. Then 𝐘 = 𝐀 𝛀 will capture the most action approximately (i.e., capture the space spanned by the first l singular vector approximately) of 𝐀 and more importantly the dimension of the space spanned by the columns of 𝐘 is much smaller than the column space of 𝐀 . Suppose 𝐐 m × l is an orthonormal basis for the column space of 𝐘 . Then we have the following random QB low-rank approximation

𝐀 𝐐𝐐 T 𝐀 = 𝐐𝐁 .

Here 𝐁 = 𝐐 T 𝐀 l × n , which is a smaller matrix than 𝐀 on which we could perform some standard factorization such as the SVD.

For a matrix whose singular values decay slowly, the above procedure may not provide good results. However, the power iteration ( 𝐀𝐀 T ) p 𝐀 can be applied to solve this problem, where p is the exponent of the power iteration. Suppose 𝐀 has the SVD decomposition (B.1). Then

(C.1) ( 𝐀𝐀 T ) p 𝐀 = 𝐔 𝚺 2 p + 1 𝐕 T .

Equation (C.1) implies that the singular values of the matrix ( 𝐀𝐀 T ) p 𝐀 decay faster than those of 𝐀 . However, both of them have the same left and right singular vectors. A basic randomized SVD algorithm (RandSVD) with subspace iteration is shown here as Algorithm 9 (see [13]). In practice, to remove the rounding errors introduced by (C.1), we use Algorithm 10 in practice to compute it [13, 36]. An optimized version of reorthogonalization was proposed in [17], where the authors used LU factorization to replace QR every time except the last iteration. As we cans see that for the RandSVD Algorithm 9, we need to access the matrix an even number times. In some cases, the input matrix is enormous, and accessing the matrix is very expensive. Randomized SVD algorithms that minimize accesses of the matrix have been proposed in [1], where the authors evaluated the co-range sketch of ( 𝐀 T A ) p 𝛀 for p 1 .

The idea for the generalized subspace iteration is very simple. Let p = v - 1 2 when v is odd in Algorithm 9. We modify steps 1–3 of Algorithm 9 when v 2 is even as follows:

  1. Generate a random Gaussian matrix 𝛀 n × l .

  2. Compute ( 𝐀𝐀 T ) p 𝐀 𝛀 and its orthonormal basis 𝐕 ;

Combine above discussion, we introduce the generalized subspace iteration here as Algorithm 11.

Algorithm 9 (A Basic Randomized SVD Algorithm.).

Algorithm 10 (Power Iteration Reorthogonalization for Algorithm 9.).

Algorithm 11 (Generalized Subspace Iteration for Algorithm 9.).

References

[1] E. K. Bjarkason, Pass-efficient randomized algorithms for low-rank matrix approximation using any number of views, SIAM J. Sci. Comput. 41 (2019), no. 4, A2355–A2383. 10.1137/18M118966XSearch in Google Scholar

[2] R. Dai, L. Li and W. Yu, Fast training and model compression of gated rnns via singular value decomposition, 2018 International Joint Conference on Neural Networks (IJCNN), IEEE Press, Piscataway (2018), 1–7. 10.1109/IJCNN.2018.8489156Search in Google Scholar

[3] P. Drineas, R. Kannan and M. W. Mahoney, Fast Monte Carlo algorithms for matrices. I. Approximating matrix multiplication, SIAM J. Comput. 36 (2006), no. 1, 132–157. 10.1137/S0097539704442684Search in Google Scholar

[4] P. Drineas, R. Kannan and M. W. Mahoney, Fast Monte Carlo algorithms for matrices. II. Computing a low-rank approximation to a matrix, SIAM J. Comput. 36 (2006), no. 1, 158–183. 10.1137/S0097539704442696Search in Google Scholar

[5] P. Drineas, R. Kannan and M. W. Mahoney, Fast Monte Carlo algorithms for matrices. III. Computing a compressed approximate matrix decomposition, SIAM J. Comput. 36 (2006), no. 1, 184–206. 10.1137/S0097539704442702Search in Google Scholar

[6] P. Drineas and M. W. Mahoney, RandNLA: Randomized numerical linear algebra, Comm. ACM 59 (2016), no. 6, 80–90. 10.1145/2842602Search in Google Scholar

[7] P. Drineas and M. W. Mahoney, Lectures on randomized numerical linear algebra, The Mathematics of Data, IAS/Park City Math. Ser. 25, American Mathematical Society, Providence (2018), 1–48. 10.1090/pcms/025/01Search in Google Scholar

[8] C. Eckart and G. Young, The approximation of one matrix by another of lower rank, Psychometrika 1 (1936), no. 3, 211–218. 10.1007/BF02288367Search in Google Scholar

[9] M. Elad and M. Aharon, Image denoising via sparse and redundant representations over learned dictionaries, IEEE Trans. Image Process. 15 (2006), no. 12, 3736–3745. 10.1109/TIP.2006.881969Search in Google Scholar

[10] G. H. Golub and C. F. Van Loan, Matrix Computations. Vol. 3, Johns Hopkins University, Baltimore, 2012. Search in Google Scholar

[11] A. Gopal and P.-G. Martinsson, The PowerURV algorithm for computing rank-revealing full factorizations, preprint (2018), https://arxiv.org/abs/1812.06007. Search in Google Scholar

[12] M. Gu and S. C. Eisenstat, Efficient algorithms for computing a strong rank-revealing QR factorization, SIAM J. Sci. Comput. 17 (1996), no. 4, 848–869. 10.1137/0917055Search in Google Scholar

[13] N. Halko, P. G. Martinsson and J. A. Tropp, Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions, SIAM Rev. 53 (2011), no. 2, 217–288. 10.1137/090771806Search in Google Scholar

[14] R. Kannan and S. Vempala, Randomized algorithms in numerical linear algebra, Acta Numer. 26 (2017), 95–135. 10.1017/S0962492917000058Search in Google Scholar

[15] H. A. L. Kiers, Towards a standardized notation and terminology in multiway analysis, J. Chemometrics 14 (2000), no. 3, 105–122. 10.1002/1099-128X(200005/06)14:3<105::AID-CEM582>3.0.CO;2-ISearch in Google Scholar

[16] T. G. Kolda and B. W. Bader, Tensor decompositions and applications, SIAM Rev. 51 (2009), no. 3, 455–500. 10.1137/07070111XSearch in Google Scholar

[17] H. Li, G. C. Linderman, A. Szlam, K. P. Stanton, Y. Kluger and M. Tygert, Algorithm 971: An implementation of a randomized algorithm for principal component analysis, ACM Trans. Math. Software 43 (2017), no. 3, Article ID 28. 10.1145/3004053Search in Google Scholar

[18] H. Li and S. Yin, Single-pass randomized algorithms for LU decomposition, Linear Algebra Appl. 595 (2020), 101–122. 10.1016/j.laa.2020.03.001Search in Google Scholar

[19] M. W. Mahoney, Randomized algorithms for matrices and data, Found. Trends Mach. Learn. 3 (2011), no. 2, 123–224. 10.1561/2200000035Search in Google Scholar

[20] M. W. Mahoney and P. Drineas, CUR matrix decompositions for improved data analysis, Proc. Natl. Acad. Sci. USA 106 (2009), no. 3, 697–702. 10.1073/pnas.0803205106Search in Google Scholar

[21] P.-G. Martinsson and S. Voronin, A randomized blocked algorithm for efficiently computing rank-revealing factorizations of matrices, SIAM J. Sci. Comput. 38 (2016), no. 5, S485–S507. 10.1137/15M1026080Search in Google Scholar

[22] L. Miranian and M. Gu, Strong rank revealing LU factorizations, Linear Algebra Appl. 367 (2003), 1–16. 10.1016/S0024-3795(02)00572-4Search in Google Scholar

[23] I. V. Oseledets, Tensor-train decomposition, SIAM J. Sci. Comput. 33 (2011), no. 5, 2295–2317. 10.1137/090752286Search in Google Scholar

[24] C.-T. Pan, On the existence and computation of rank-revealing LU factorizations, Linear Algebra Appl. 316 (2000), no. 1–3, 199–222. 10.1016/S0024-3795(00)00120-8Search in Google Scholar

[25] A. Rotbart, G. Shabat, Y. Shmueli and A. Averbuch, Randomized LU decomposition: An algorithm for dictionaries construction, preprint (2015), https://arxiv.org/abs/1502.04824. Search in Google Scholar

[26] K. K. Sabelfeld and N. S. Mozartova, Sparsified randomization algorithms for low rank approximations and applications to integral equations and inhomogeneous random field simulation, Math. Comput. Simulation 82 (2011), no. 2, 295–317. 10.1016/j.matcom.2011.08.002Search in Google Scholar

[27] G. Shabat, Randomized LU matrix factorization code. Search in Google Scholar

[28] G. Shabat, Y. Shmueli, Y. Aizenbud and A. Averbuch, Randomized LU decomposition, Appl. Comput. Harmon. Anal. 44 (2018), no. 2, 246–272. 10.1016/j.acha.2016.04.006Search in Google Scholar

[29] G. W. Stewart, Updating a rank-revealing ULV decomposition, SIAM J. Matrix Anal. Appl. 14 (1993), no. 2, 494–499. 10.1137/0614034Search in Google Scholar

[30] G. W. Stewart, The QLP approximation to the singular value decomposition, SIAM J. Sci. Comput. 20 (1999), no. 4, 1336–1348. 10.1137/S1064827597319519Search in Google Scholar

[31] J. A. Tropp, A. Yurtsever, M. Udell and V. Cevher, Practical sketching algorithms for low-rank matrix approximation, SIAM J. Matrix Anal. Appl. 38 (2017), no. 4, 1454–1485. 10.1137/17M1111590Search in Google Scholar

[32] L. R. Tucker, Implications of factor analysis of three-way matrices for measurement of change, Probl. Meas. Change 15 (1963), 122–137. 10.1108/09534810210423008Search in Google Scholar

[33] L. R. Tucker, The extension of factor analysis to three-dimensional matrices, Contrib. Math. Psychol. (1964), Article ID 110119. Search in Google Scholar

[34] L. R. Tucker, Some mathematical notes on three-mode factor analysis, Psychometrika 31 (1966), 279–311. 10.1007/BF02289464Search in Google Scholar PubMed

[35] M. Udell and A. Townsend, Why are big data matrices approximately low rank?, SIAM J. Math. Data Sci. 1 (2019), no. 1, 144–160. 10.1137/18M1183480Search in Google Scholar

[36] S. Voronin and P.-G. Martinsson, RSVDPACK: An implementation of randomized algorithms for computing the singular value, interpolative, and cur decompositions of matrices on multi-core and gpu architectures, preprint (2015), https://arxiv.org/abs/1502.05366. Search in Google Scholar

[37] W. Yu, Y. Gu, J. Li, S. Liu and Y. Li, Single-pass PCA of large high-dimensional data, preprint (2017), https://arxiv.org/abs/1704.07669. 10.24963/ijcai.2017/468Search in Google Scholar

[38] W. Yu, Y. Gu and Y. Li, Efficient randomized algorithms for the fixed-precision low-rank matrix approximation, SIAM J. Matrix Anal. Appl. 39 (2018), no. 3, 1339–1359. 10.1137/17M1141977Search in Google Scholar

Received: 2023-05-25
Revised: 2023-07-27
Accepted: 2023-08-02
Published Online: 2023-08-22
Published in Print: 2023-09-01

© 2023 Walter de Gruyter GmbH, Berlin/Boston

Downloaded on 20.1.2025 from https://www.degruyter.com/document/doi/10.1515/mcma-2023-2012/html
Scroll to top button