摘要
在贪婪Kaczmarz方法中, 通过对系数矩阵进行正交三角分解引入右预处理子能够提高贪婪Kaczmarz方法的收敛速率。但在系数矩阵的行数远大于列数的情况下, 正交三角分解的成本过高。为降低预处理的成本, 通过引入Count Sketch变换, 提出了基于Count Sketch的预处理贪婪Kaczmarz方法, 并对新方法进行了收敛性分析。理论分析说明了新方法在系数矩阵条件数较大时比已有方法具有更好的收敛速率。数值实验验证了新方法的有效性。
考虑求解大规模超定相容线性方程组
(1) |
其中, 矩阵, , , 为未知向量。Kaczmarz方
(2) |
式中:表示欧几里得范数; 为矩阵的第行; 为向量的第个元素, 。
2009年, Strohmer和Vershyni
Sketching方法是将Sketch矩阵作用于原始矩阵的过程, 其中是从矩阵的某个分布中指定的一个的随机矩阵, 且 [
在基于sketching预处理Kaczmarz方
本文采用表示由矩阵列向量张成的值空间。其中,。, ,和分别表示矩阵的转置, Moore-Penrose伪逆, Frobenius范数, 最小非零奇异值和最大奇异值; 是线性代数方程组(1)的最小范数解。
Kaczmarz方法的收敛速率与行指标的选择策略密切相关, 选取与当前迭代点距离最大超平面的贪婪距离准则便是一种有效策略, Nutini
结合贪婪距离策略得到的贪婪Kaczmarz方法(见算法1)在文献[
算法1 贪婪Kaczmarz方
引理1 [
对于,
贪婪Kaczmarz方法的收敛速度很大程度上依赖于系数矩阵的条件数, 当较大时, 贪婪Kaczmarz方法的收敛速度会变慢。解决此问题的方法之一是使用预处理矩阵。由于本问题中, 因此考虑如下形式的右预处理方法:
其中, , 且。
因此, 最理想的预处理子应满足。受到文献[
注意到对矩阵进行正交三角分解的成本为, 这对于高度超定的系统()来说过高。因此文献[
Sketching方法中, 一种关键技术是Johnson-Lindenstrauss型嵌入算
定义1
通过定义1可以发现, Count Sketch矩阵由每列有且仅有一个1的矩阵和对角元为1或-1的对角矩阵相乘得到, 它与系数矩阵相乘的成本仅为, 且和均可以低成本的构造, 其中为矩阵的非零项个数。
Count sketch变换还满足如下引理:
引理2 [
(3) |
(4) |
Count sketch矩阵的这些性质也引起了学者的关注, 例如, 文献[
本文提出基于Count Sketch的预处理贪婪Kaczmarz方法, 如算法2所示。
算法2 基于Count Sketch的预处理贪婪Kaczmarz方法。① 创建Count Sketch矩阵, 并计算。②对进行正交三角分解, , , 并将作为右预处理矩阵。③计算, 并记的第行为。④置。⑤计算。⑥计算。⑦置, 转步骤⑤。⑧计算。
参数 | PCSGK | GK | PGK |
---|---|---|---|
计算与的乘积 | -- | -- | |
系数矩阵的正交三角分解 | -- | ||
矩阵求逆 | -- | ||
对系数矩阵作用右预处理子 | -- | ||
每步选取行指标 | |||
近似解更新 | |||
迭代步数 |
从
同时, 注意到当系数矩阵缩放条件数较大时, 经典的贪婪Kaczmarz方法可能需要很多次迭代才能收敛, 如果此时用进行预处理, 则有, 则算法可以在步内收敛。此时预处理的贪婪Kaczmarz方法在迭代步数上的改进可以远远大于预处理的成本。此外, 在很多问题上, 预处理只需要进行一次, 因此对于条件数较大的系统, 基于Count Sketch的预处理贪婪Kaczmarz方法是一个较为高效的选择。
本节说明基于Count Sketch的预处理贪婪Kaczmarz方法的收敛性。定理1是本文的关键定理:
定理1 若是一个Count Sketch变换, , , 初始估计, 记基于Count Sketch的预处理贪婪Kaczmarz方法生成的迭代序列为。 则在的概率下, 序列收敛到的最小范数解, 且满足
对于,
(5) |
其中, , , 为矩阵的秩, 。
证明 由于基于Count Sketch的预处理贪婪Kaczmarz方法本质上为用贪婪Kaczmarz方法求解线性方程组, 即, 则由引理1, 有
(6) |
对于,
(7) |
接下来对矩阵的性质进行研究。根据引理2中
(8) |
通过记, , 可将
(9) |
而,
, , |
故对所有, 。
所以
(10) |
又因为
所以
(11) |
将
备注 根据定义1, 矩阵的一行或几行元素可能为0, 这意味着可能存在零行, 则有
因此, 将上式代入
注意到, 对于引理1, 由于
当系数矩阵病态时, 与相差较大, 若, 则小于, 基于Count Sketch的预处理贪婪Kaczmarz方法从而具有更快的收敛速度。
本节通过数值实验比较贪婪Kaczmarz(GK)方法、Count Sketch最大加权残差Kaczmarz(CS-MWRK)方法、正交三角分解预处理的贪婪Kaczmarz(PGK)方法和基于Count Sketch的预处理贪婪Kaczmarz(PCSGK)方法, 数值结果显示新方法在迭代步数(简记为IT)与计算时间(简记为CPU)方面均具有较好的性能。
在实验中, 初始估计取为零向量, 构造一个精确解, 并且右端项。考虑到随机性,本节所有数值结果取20次独立实验的平均值。停机准则为相对残差(简记为RES)
或者迭代步数超过10万步。实验表格中, 若在10万步内未达到指定精度, 即用'- -'表示。对于正交三角分解预处理的贪婪Kaczmarz方法和基于Count Sketch的预处理贪婪Kaczmarz方法, 计算时间为预处理时间与迭代时间之和。
例1 生成一个的随机高斯矩阵并进行奇异值分解, 然后将其奇异值替换为, , 以获取一个新的系数矩阵, 该矩阵的条件数即为。通过把取为50, 分别取2和2.5将系数矩阵条件数分别控制为2 500.00和17 677.67; 通过把分别取为5, 10和15来改变Sketching的行数。
矩阵规模 | 5 000×50 | 10 000×50 | 50 000×50 | |||||||
---|---|---|---|---|---|---|---|---|---|---|
算法 | IT | CPU | RES | IT | CPU | RES | IT | CPU | RES | |
GK | 26 075.00 | 1.927 1 |
9.99×1 | 14 282.00 | 3.910 1 |
9.97×1 | 9 010.00 | 14.641 7 |
9.78×1 | |
CS-MWRK | 75 153.80 | 0.584 5 |
9.90×1 | 42019.45 | 0.341 5 |
9.88×1 | 35 374.60 | 0.347 7 |
9.87×1 | |
46 532.65 | 0.435 0 |
9.91×1 | 33059.60 | 0.362 4 |
9.87×1 | 24 240.15 | 0.237 7 |
9.82×1 | ||
43 037.60 | 0.510 7 |
9.89×1 | 29658.40 | 0.393 6 |
9.90×1 | 22 273.45 | 0.280 5 |
9.84×1 | ||
PGK | 50.00 | 0.009 3 |
8.94×1 | 44.00 | 0.025 6 |
9.16×1 | 37.00 | 0.141 8 |
9.86×1 | |
PCSGK | 62.60 | 0.007 9 |
9.59×1 | 53.80 | 0.020 7 |
9.39×1 | 45.00 | 0.093 3 |
9.16×1 | |
55.15 | 0.008 1 |
9.41×1 | 49.05 | 0.018 1 |
8.97×1 | 40.05 | 0.080 3 |
9.08×1 | ||
51.40 | 0.006 3 |
9.39×1 | 47.60 | 0.017 5 |
9.39×1 | 38.40 | 0.079 2 |
9.43×1 |
矩阵规模 | 5 000×50 | 10 000×50 | 50 000×50 | |||||||
---|---|---|---|---|---|---|---|---|---|---|
算法 | IT | CPU | RES | IT | CPU | RES | IT | CPU | RES | |
GK | 16 940.00 | 1.152 7 |
9.97×1 | 11 319.00 | 2.949 0 |
9.75×1 | 8 396.00 | 16.146 9 |
9.72×1 | |
CS-MWRK | 40 299.80 | 0.313 8 |
9.87×1 | 35 991.45 | 0.262 3 |
9.86×1 | 34 652.20 | 0.324 8 |
9.87×1 | |
28 866.85 | 0.274 8 |
9.83×1 | 26 393.20 | 0.250 9 |
9.89×1 | 26 023.40 | 0.317 9 |
9.87×1 | ||
26 065.40 | 0.332 2 |
9.73×1 | 23 087.00 | 0.268 1 |
9.89×1 | 22 005.00 | 0.276 7 |
9.80×1 | ||
PGK | 48.00 | 0.010 7 |
8.78×1 | 44.00 | 0.026 3 |
9.62×1 | 40.00 | 0.169 3 |
7.96×1 | |
PCSGK | 61.75 | 0.007 0 |
9.52×1 | 58.40 | 0.019 9 |
9.13×1 | 44.05 | 0.096 4 |
8.52×1 | |
54.60 | 0.006 8 |
9.43×1 | 48.15 | 0.018 3 |
8.94×1 | 40.40 | 0.085 3 |
9.19×1 | ||
51.60 | 0.006 0 |
9.21×1 | 47.00 | 0.016 3 |
9.17×1 | 40.80 | 0.080 7 |
9.03×1 |
从
从

图1 矩阵规模为时的收敛曲线
Fig.1 Convergence curves for matrix of , with
例2 选取了佛罗里达稀疏矩阵库中的一些矩阵进行实验, 其中欠定矩阵取其转置。这里包含矩阵lp_fit2d、lp_d6cube、relat5和relat6。
矩阵名称 | lp_fit2 | lp_d6cube | relat5 | relat6 | |
---|---|---|---|---|---|
10 524×25 | 6 184×415 | 340×35 | 2 340×157 | ||
稠密度/% | 49.05 | 1.47 | 8.89 | 2.21 | |
条件数 |
1.74×1 |
4.93×1 | Inf | Inf | |
300 | 800 | 70 | 300 | ||
GK | IT | 192.00 | 7 130.00 | 196.00 | 1 359.00 |
CPU | 0.057 2 | 0.769 4 | 0.005 1 | 0.079 4 | |
RES |
7.76×1 |
9.56×1 |
9.82×1 |
9.82×1 | |
CS-MWRK | IT | 26 723.15 | 53 185.70 | 334.65 | 3 544.70 |
CPU | 0.503 4 | 3.426 3 | 0.012 1 | 0.154 9 | |
RES |
9.85×1 |
9.78×1 |
9.53×1 |
9.93×1 | |
PGK | IT | 31.00 | 521.00 | 56.00 | 283.00 |
CPU | 0.038 4 | 12.527 1 | 0.004 5 | 0.411 3 | |
RES |
8.09×1 |
9.89×1 |
8.50×1 |
9.91×1 | |
PCSGK | IT | 35.45 | 1 631.30 | 113.20 | 763.10 |
CPU | 0.012 7 | 2.827 1 | 0.002 1 | 0.082 1 | |
RES |
9.85×1 |
9.96×1 |
9.68×1 |
9.90×1 |
从

图2 矩阵relat5的收敛曲线
Fig.2 Convergence curves for matrix relat5
从
提出了一种基于Count Sketch的预处理贪婪Kaczmarz方法, 理论分析证明了新方法的收敛性, 且在系数矩阵条件数较大的情况下, 基于Count Sketch的预处理贪婪Kaczmarz方法的收敛因子小于经典的收敛因子, 即新方法具有较快的收敛速度。数值实验的结果表明, 提出的新方法在计算时间与迭代步数方面均有较大的优势。
基于Count Sketch的预处理贪婪Kaczmarz方法能够快速求解超定线性方程组(1)的最小范数解, 主要原因在于采用了正交三角分解进行预处理, 并采用贪婪策略选择工作行。因此如何选用成本更低的预处理以及更高效选取工作行的策略, 仍然是值得研究的问题。
作者贡献声明
叶雨欣:算法设计和算法研究执行,收敛性证明,数值实验和数据分析、论文初稿写作;
殷俊锋:研究构思,实验设计指导,数据分析,论文写作与修改。
参考文献
KACZMARZ S. Angenäherte auflösung von systemen linearer gleichungen [J]. Bulletin International de l'Academie Polonaise des Sciences et des Lettres, 1937, 35: 355. [百度学术]
CENSOR Y. Parallel application of block-iterative methods in medical imaging and radiation therapy[J] . Mathematical programming, 1988, 42(1): 307. [百度学术]
ELBLE J M, SAHINIDIS N V, VOUZIS P. GPU computing with Kaczmarz’s and other iterative algorithms for linear systems[J]. Parallel computing, 2010, 36(5/6): 215. [百度学术]
BYRNE C. A unified treatment of some iterative algorithms in signal processing and image reconstruction[J]. Inverse problems, 2003, 20(1): 103. [百度学术]
STROHMER T, VERSHYNIN R. A randomized Kaczmarz algorithm with exponential convergence[J]. Journal of Fourier Analysis and Applications, 2009, 15(2): 262. [百度学术]
NUTINI J, SEPEHRY B, LARADJI I, et al. Convergence rates for greedy Kaczmarz algorithms, and faster randomized Kaczmarz rules using the orthogonality graph[EB/OL].[2023-04-22 ]https://doi.org/10.48550/arXiv.1612.07838. [百度学术]
BAI Z Z, WU W T. On greedy randomized Kaczmarz method for solving large sparse linear systems[J]. SIAM Journal on Scientific Computing, 2018, 40(1): A592. [百度学术]
BAI Z Z, WU W T. On relaxed greedy randomized Kaczmarz methods for solving large sparse linear systems[J]. Applied Mathematics Letters, 2018, 83: 21. [百度学术]
杜亦疏, 殷俊锋, 张科. 求解大型稀疏线性方程组的贪婪距离随机 Kaczmarz 方法[J]. 同济大学学报 (自然科学版), 2020, 48(8): 1224. [百度学术]
DU Yishu, YIN Junfeng, ZHANG Ke. Greedy randomized-distance Kaczmarz method for solving large sparse linear systems[J]. Journal of Tongji University (Natural Science), 2020, 48(8): 1224. [百度学术]
王泽, 殷俊锋. 求解线性方程组稀疏解的稀疏贪婪随机Kaczmarz算法[J]. 同济大学学报 (自然科学版), 2021, 49(11): 1505. [百度学术]
WANG Ze, YIN Junfeng. Sparse greedy randomized Kaczmarz method for sparse solutions to linear equations[J]. Journal of Tongji University (Natural Science), 2021, 49(11): 1505. [百度学术]
XIAO A Q, YIN J F, ZHENG N. On fast greedy block Kaczmarz methods for solving large consistent linear systems[J]. Computational and Applied Mathematics, 2023, 42(3): 119. [百度学术]
WOODRUFF D P. Sketching as a tool for numerical linear algebra[J]. Foundations and Trends® in Theoretical Computer Science, 2014, 10(1/2): 1. [百度学术]
BOUTSIDIS C, DRINEAS P, MAGDON-ISMAIL M. Near-optimal column-based matrix reconstruction[J]. SIAM Journal on Computing, 2014, 43(2): 687. [百度学术]
AILON N, CHAZELLE B. Approximate nearest neighbors and the fast Johnson-Lindenstrauss transform[C]//Proceedings of the thirty-eighth annual ACM symposium on Theory of computing. 2006: 557-563. [百度学术]
CHARIKAR M, CHEN K, FARACH-COLTON M. Finding frequent items in data streams[J]. Theoretical Computer Science, 2004, 312(1): 3. [百度学术]
THORUP M, ZHANG Y. Tabulation-based 5-independent hashing with applications to linear probing and second moment estimation[J]. SIAM Journal on Computing, 2012, 41(2): 293. [百度学术]
KANE D M, Nelson J. Sparser Johnson-Lindenstrauss transforms[J]. Journal of the ACM (JACM), 2014, 61(1): 1. [百度学术]
KATRUTSA A, OSELEDETS I. Preconditioning Kaczmarz method by sketching[EB/OL].[2023-04-22 ] https://doi.org/10.48550/arXiv.1903.01806.. [百度学术]
REBROVA E, NEEDELL D. On block Gaussian sketching for the Kaczmarz method[J]. Numerical Algorithms, 2021, 86(1): 443. [百度学术]
ZHANG Y, LI H. A count sketch maximal weighted residual Kaczmarz method for solving highly overdetermined linear systems[J]. Applied Mathematics and Computation, 2021, 410: 126486. [百度学术]
MCCORMICK S F. The methods of Kaczmarz and row orthogonalization for solving linear equations and least squares problems in Hilbert space[J]. Indiana University Mathematics Journal, 1977, 26(6): 1137. [百度学术]
DU K, GAO H. A new theoretical estimate for the convergence rate of the maximal weighted residual Kaczmarz algorithm[J]. Numerical Mathematics: Theory, Methods and Applications, 2019, 12(2): 627. [百度学术]
JOHNSON W B, LINDENSTRAUSS J. Extensions of Lipschitz mappings into a Hilbert space[J]. Contemporary Mathematics, 1984, 26: 189. [百度学术]
MENG X, MAHONEY M W. Low-distortion subspace embeddings in input-sparsity time and applications to robust linear regression[C]//Proceedings of the Forty-Fifth Annual ACM Symposium on Theory of Computing.[S.l.] :ACM,2013: 91-100. [百度学术]
ZHANG P, LI L, ZHANG P. A count sketch maximal weighted residual kaczmarz method with oblique projection for highly overdetermined linear systems[J]. Advances in Pure Mathematics, 2022, 12(4): 260. [百度学术]