Approximate matrix multiplication by row sampling
Library 路 Source module
Approximate matrix multiplication by row sampling
For A : Matrix n q 饾暅, B : Matrix n r 饾暅 (written \mathbf{A}, \mathbf{B}) and the row-sampling sketch \mathbf{S} with law NLAlib.samplingSketch k p (weights p_i), the sampled product \mathbf{A}^{\mathsf{H}} \mathbf{S}^{\mathsf{H}} \mathbf{S} \mathbf{B} is the sum of \lvert k \rvert i.i.d. rank-one atoms \frac{1}{\lvert k \rvert \, p_{\iota}} (\mathbf{A}_{\iota})^{\mathsf{H}} \mathbf{B}_{\iota} for i.i.d. sampled rows \iota (NLAlib.conjTranspose_samplingSketchMatrix_mul_mul). It is unbiased when every zero weight sits on a row where \mathbf{A} or \mathbf{B} vanishes, its squared Frobenius error has the exact mean \frac{1}{\lvert k \rvert} \Bigl( \sum_i \frac{\|\mathbf{A}_i\|^2 \|\mathbf{B}_i\|^2}{p_i} - \|\mathbf{A}^{\mathsf{H}} \mathbf{B}\|_{\mathsf{F}}^2 \Bigr), and under the domination \|\mathbf{A}_i\| \, \|\mathbf{B}_i\| \le L p_i that mean is at most L \|\mathbf{A}\|_{\mathsf{F}} \|\mathbf{B}\|_{\mathsf{F}} / \lvert k \rvert; Markov's inequality gives the tail. The error and its event are those of the JL-moment form (NLAlib.HasJLMoment.measureReal_frobNorm_conjTranspose_mul_sub_ge_le), here over 饾暅.
Degenerate cases: for empty k, \mathbf{S} = \mathbf{0} and the sampled product is \mathbf{0}, hence [Nonempty k] on every mean and tail; the integrability statements need neither it nor \sum_i p_i = 1. A zero weight with \mathbf{A}_i \ne \mathbf{0} and \mathbf{B}_i \ne \mathbf{0} biases the estimator, which the support hypothesis excludes and the domination hypothesis implies.
In the spectral norm, matrix Bernstein for the rectangular atoms (NLAlib.Probability.MatrixConcentration.Bernstein) needs a uniform atom bound and the two one-sided variances, hence two separate dominations \|\mathbf{A}_i\|^2 \le a\,p_i and \|\mathbf{B}_i\|^2 \le \mathbf{b}\,p_i: they bound the variances by \mathbf{b}\|\mathbf{A}\|_2^2/\lvert k\rvert and a\|\mathbf{B}\|_2^2/\lvert k\rvert and the atoms by 2\sqrt{a\mathbf{b}}/\lvert k\rvert, and imply the product domination with L = \sqrt{a\mathbf{b}}; the product domination alone does not bound the variances (a row with \|\mathbf{A}_i\| large and \|\mathbf{B}_i\| small). At p_i \propto \|\mathbf{A}_i\|^2 + \|\mathbf{B}_i\|^2 this is the stable-rank form. Without replacement the weights are uniform and matrix Bernstein without replacement (NLAlib.Probability.MatrixConcentration.BernsteinWithoutReplacement) gives the same bound.
Proofs. Every expectation is transported to \lvert k \rvert i.i.d. indices (NLAlib.samplingSketch_eq_map), where the sampled product is a sum of i.i.d. atoms whose weighted mean is \mathbf{A}^{\mathsf{H}} \mathbf{B} / \lvert k \rvert; unbiasedness is linearity, the exact second moment is the additivity of the Frobenius variance over independent centred summands (NLAlib.integral_sum_mul_sum_of_iIndepFun under the trace), the domination bound is the identity with w_i^2 / p_i \le L w_i, where w_i = \|\mathbf{A}_i\| \, \|\mathbf{B}_i\|, and Cauchy鈥揝chwarz, and the tails are Markov's inequality on the square.
Main results
* NLAlib.integral_conjTranspose_mul_mul_of_hasLaw_samplingSketch: unbiasedness. * NLAlib.integral_frobNorm_conjTranspose_mul_sub_sq_of_hasLaw_samplingSketch: the exact second moment. * NLAlib.integral_frobNorm_conjTranspose_mul_sub_sq_le_of_hasLaw_samplingSketch: the domination bound. * NLAlib.measureReal_frobNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_samplingSketch, NLAlib.measureReal_frobNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_samplingSketch_of_ne_zero: tails. * NLAlib.measureReal_specNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_samplingSketch and measureReal_specNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_samplingSketchWithoutReplacement: approximate multiplication in the spectral norm, both sampling models.
Declarations
- NLAlib.integrable_conjTranspose_mul_mul_of_hasLaw_samplingSketch
- NLAlib.integrable_frobNorm_conjTranspose_mul_sub_sq_of_hasLaw_samplingSketch
- NLAlib.integral_conjTranspose_mul_mul_of_hasLaw_samplingSketch
- NLAlib.integral_frobNorm_conjTranspose_mul_sub_sq_le_of_hasLaw_samplingSketch
- NLAlib.integral_frobNorm_conjTranspose_mul_sub_sq_of_hasLaw_samplingSketch
- NLAlib.measureReal_frobNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_samplingSketch
- NLAlib.measureReal_frobNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_samplingSketch_of_ne_zero
- NLAlib.measureReal_specNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_samplingSketch
- NLAlib.measureReal_specNorm_conjTranspose_mul_sub_ge_le_of_hasLaw_samplingSketchWithoutReplacement