arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1108.1320cs.DScs.NAmath.NAstat.CO
收藏

压缩矩阵乘法

Compressed Matrix Multiplication

IT University of Copenhagen(哥本哈根 IT 大学)

Rasmus Pagh

AI总结:

针对样本协方差矩阵计算和向量稀疏基变换问题,提出一种基于哈希和多项式压缩的矩阵乘法近似算法,通过FFT实现亚二次时间,并利用纠错码恢复显著项。

摘要:

受样本协方差矩阵计算以及将向量集合变换到稀疏基的问题启发,我们提出一种简单算法,用于计算两个n×n实矩阵A和B的乘积的近似值。令||AB||_F表示AB的Frobenius范数,b为决定时间/精度权衡的参数。给定两两独立的哈希函数h_1,h_2: [n] -> [b]以及s_1,s_2: [n] -> {-1,+1},算法首先将矩阵乘积“压缩”为多项式p(x) = sum_{k=1}^n (sum_{i=1}^n A_{ik} s_1(i) x^{h_1(i)}) (sum_{j=1}^n B_{kj} s_2(j) x^{h_2(j)})。利用FFT进行多项式乘法,我们可以在Õ(n^2+ n b)时间内计算c_0,...,c_{b-1}使得sum_i c_i x^i = (p(x) mod x^b) + (p(x) div x^b)。然后,(AB)_{ij}的无偏估计量(方差至多为||AB||_F^2 / b)可计算为:C_{ij} = s_1(i) s_2(j) c_{(h_1(i)+h_2(j)) mod b}。我们的方法还导出了一个算法,当A和B最多有N个非零项且AB最多有b个非零项时,可以在Õ(N + nb)时间内高概率精确计算AB。此外,我们以一种新颖的方式使用纠错码在近线性时间内恢复AB的显著项。

英文摘要:

Motivated by the problems of computing sample covariance matrices, and of transforming a collection of vectors to a basis where they are sparse, we present a simple algorithm that computes an approximation of the product of two n-by-n real matrices A and B. Let ||AB||_F denote the Frobenius norm of AB, and b be a parameter determining the time/accuracy trade-off. Given 2-wise independent hash functions $_1,h_2: [n] -> [b], and s_1,s_2: [n] -> {-1,+1} the algorithm works by first "compressing" the matrix product into the polynomial p(x) = sum_{k=1}^n (sum_{i=1}^n A_{ik} s_1(i) x^{h_1(i)}) (sum_{j=1}^n B_{kj} s_2(j) x^{h_2(j)}) Using FFT for polynomial multiplication, we can compute c_0,...,c_{b-1} such that sum_i c_i x^i = (p(x) mod x^b) + (p(x) div x^b) in time Õ(n^2+ n b). An unbiased estimator of (AB)_{ij} with variance at most ||AB||_F^2 / b can then be computed as: C_{ij} = s_1(i) s_2(j) c_{(h_1(i)+h_2(j)) mod b. Our approach also leads to an algorithm for computing AB exactly, whp., in time Õ(N + nb) in the case where A and B have at most N nonzero entries, and AB has at most b nonzero entries. Also, we use error-correcting codes in a novel way to recover significant entries of AB in near-linear time.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑