EECS 275 Matrix Computation: Ming-Hsuan Yang
EECS 275 Matrix Computation: Ming-Hsuan Yang
Ming-Hsuan Yang
Electrical Engineering and Computer Science
University of California at Merced
Merced, CA 95344
http://faculty.ucmerced.edu/mhyang
Lecture 22
1 / 21
Overview
2 / 21
Topics
3 / 21
4 / 21
n
X
A(i) B(i)
|
{z }
i=1
IRmp
where A(i) are the i-th column of A and B(i) is the i-th row of B
Each term is a rank-one matrix
Random sampling algorithm
I
I
AB
1 X 1 (jt )
A B
s
p | {z (jt})
t=1 jt
IRmp
6 / 21
In matrix notation
Amn Bnp Cms Rsp
Create C and R i.i.d. trials with replacement
For t = 1 up to s, pick a column A(jt ) and a row B(jt ) with probability
kA(i) k2 kB(i) k2
P
Pr (jt = i) = n
(i)
i=1 kA k2 kB(i) k2
Include A(jt ) /(spjt )1/2 as a column of C and B(jt ) /(spjt )1/2 as a row
of R
7 / 21
kAB CRk2,F
kAkF kBkF
s
8 / 21
4 log s
>
>
E (kAA CC k2 )
kAkF kAk2
s
The sampling procedure is slightly different; s columns/rows are kept
in expectation, i.e., column i is picked with probability
Pr (picking i) = min(1,
skA(i) k22
)
kAk2F
9 / 21
Original matrix A
Hk Hk> A
11 / 21
12 / 21
CX matrix decomposition
Goal: Find Amn Cmc Xcn so that A CX small in some norm
One way to approach this is
min kA CX kF = kA C (C A)kF
X IRcn
Relative error CX
Relative error CX decomposition
I
I
Theorem
For any k, let Ak be the best rank k approximation to A. In O(SVDk (A))
we can compute pi such that if c = O(k log k/2 ) then with probability at
least 1
minX IRcn kA CX kF
= kA CC AkF
(1 + )kA Ak kF
14 / 21
CUR decomposition
Goal: Find Amn Cmc Ucr Rr n so that kA CURk is small in
some norm
Why: After making two passes over A, one can compute provably C ,
U, and R and store them (sketch) instead of A of O(m + n) vs.
O(mn)
> where ran(A) = p
SVD of Amn = Ump pp Vpn
Exact computation of the SVD takes O(min(mn2 , m2 n)) and the top
k left/right singular vectors/values can be computed from
Lanczos/Arnoldi methods
Rank k approximation Ak = Uk kk Vk> where kk is a diagonal
matrix with top k singular values of A
Note that the columns of Uk are linear combinations of all columns of
A, and the rows of Vk> are linear combinations of all rows of A
15 / 21
UC
m
VC>
c
Compute U:
I
I
CUR
D
C
m c
D
r c
R
r n
Theorem
Given C , in O(c 2 m) time, one can compute qi such that
kA CURkF (1 + )kA C (C A)kF
holds with probability at least 1 if r = O(c log c/2 ) rows
17 / 21
(1 + )kA Uk k Vk> kF
= (1 + )kA Ak kF
Element-wise sampling
Main idea:
I
zero out a large number of elements of A, and scale the remaining ones
appropriately
compute the singular values of the resulting sparse matrix using
iterative methods
sA2
good choice for pij = P ijA2 where s denotes the expected number of
i,j
ij
20 / 21
21 / 21