Low Rank Approximation Lecture 5
Daniel Kressner Chair for Numerical Algorithms and HPC Institute of Mathematics, EPFL daniel.kressner@epfl.ch
1
Low Rank Approximation Lecture 5 Daniel Kressner Chair for - - PowerPoint PPT Presentation
Low Rank Approximation Lecture 5 Daniel Kressner Chair for Numerical Algorithms and HPC Institute of Mathematics, EPFL daniel.kressner@epfl.ch 1 Randomized column/row sampling Aim: Obtain rank- r approximation from randomly selected rows and
1
Aim: Obtain rank-r approximation from randomly selected rows and columns of A. Popular sampling strategies:
◮ Uniform sampling. ◮ Sampling based on row/column norms. ◮ Sampling based on more complicated quantities.
2
Exponential function example from Lecture 4 (Slide 14). Comparison between best approximation, greedy approximation, approximation obtained by randomly selecting rows.
2 4 6 8 10 10 -10 10 -5 10 0 2 4 6 8 10 10 -10 10 -5 10 0 2 4 6 8 10 10 -10 10 -5 10 0 2 4 6 8 10 10 -10 10 -5 10 0 3
A simple way to fool uniformly random row selection: U = 0(n−r)×r Ir
4
Basic algorithm aiming at rank-r approximation:
m × k matrix C.
◮ Can be combined with streaming algorithm [Liberty’2007] to limit
memory/cost of working with C.
◮ Quality of approximation crucially depends on sampling strategy.
5
For any matrix C ∈ Rm×r, let Q be the matrix computed above. Then A − QQTA2
2 ≤ σr+1(A)2 + 2AAT − CCT2.
(A − QQTA)(A − QQTA)T = (I − QQT)CCT(I − QQT) + (I − QQT)(AAT − CCT)(I − QQT) Hence, A − QQTA2
2
= λmax
≤ λmax
= σr+1(C)2 + AAT − CCT2. The proof is completed by applying Weyl’s inequality: σr+1(C)2 = λr+1(CCT) ≤ λr+1(AAT) + AAT − CCT2.
6
Using the lemma, the goal now becomes to approximate the matrix product AAT using column samples of A. Notation: A = a1 · · · an
C = c1 · · · ck
Input: A ∈ Rm×n, probabilities p1, . . . , pn = 0, integer k. Output: C ∈ Rm×k containing selected columns of A.
1: for t = 1, . . . , k do 2:
Pick jt ∈ {1, . . . , n} with P[jt = ℓ] = pℓ, ℓ = 1, . . . , n, independently and with replacement.
3:
Set ct = ajt/
4: end for
7
For the matrix C returned by algorithm, it holds that E[CCT] = AAT, Var[(CCT)ij] = 1 k
n
a2
iℓa2 jℓ
pℓ − 1 k (AAT)2
ij.
t )ij = 1 kpjt ai,jtaj,jt, for which
E[Xt] =
n
pℓ 1 kpℓ ai,ℓaj,ℓ = 1 k (AAT)ij. Analogously, Var(Xt) = E[(Xt−E[Xt])2] = E[X 2
t ]−E[Xt]2 = 1
k2
n
a2
iℓa2 jℓ
pℓ − 1 k2 (AAT)2
ij.
Because of independence, it follows E[
t Xt] = k · E[Xt] = (AAT)ij,
and analogously for variance.
8
As a consequence of the lemma, E[AAT − CCT2
F]
=
E[(AAT − CCT)2
ij]
=
Var[(CCT)ij] = 1 k
a2
iℓa2 jℓ
pℓ − 1 k (AAT)2
ij
1 k n
1 pℓ aℓ4
2 − AAT2 F
The choice pℓ = aℓ2
2/A2 F minimizes E[AAT − CCT2 F] and yields
E[AAT − CCT2
F] = 1
k
F − AAT2 F
first-order conditions of constrained optimization problem.
9
Norm based sampling: Input: A ∈ Rm×n, integer k. Output: C ∈ Rm×k containing selected columns of A.
1: Set pℓ = aℓ2
2/A2 F for ℓ = 1, . . . , n.
2: for t = 1, . . . , k do 3:
Pick jt ∈ {1, . . . , n} with P[jt = ℓ] = pℓ, ℓ = 1, . . . , n, independently and with replacement.
4:
Set ct = ajt/
5: end for 5: Compute SVD C = UΣV T and set Q = Ur ∈ Rm×r. 5: Return low-rank approximation QQTA.
10
For the matrix C returned by algorithm, it holds with probability 1 − δ that AAT − CCTF ≤ η √ k AF, where η = 1 +
F(i1, i2, . . . , ik) = AAT − CCTF, with C = ai1 · · · aik
(w.l.o.g. the first one) on F: |F(i1, i2, . . . , ik) − F(i′
1, i2, . . . , ik)|
=
CCT − C′C′TF ≤ 1 kpi1 ai12
2 +
1 kpi′
1
ai′
12
2
≤ 2 k A2
F := ∆.
11
This implies that Doob martingales gℓ = E[f(i1, . . . , ik)|i1, . . . , iℓ] for 1 ≤ ℓ ≤ k satisfy |gℓ+1 − gℓ| ≤ ∆. Note that gk = E[AAT − CCTF]. By lemma and Jensen’s inequality we know that gk ≤ A2
F/
√
gk yields P
F/
√ k + γ
Setting γ =
12
For the matrix Q returned by the algorithm above it holds that E
2
r+1(A) + εA2 F for k ≥ 4/ε2.
With probability at least 1 − δ, A − QQTA2
2 ≤ σ2 r+1(A) + εA2 F for k ≥ 4(1 +
Remarks:
◮ Dependence of k on ε pretty bad. Unlikely to achieve something
significantly better without assuming further properties of A (e.g., incoherence of singular vectors) with sampling based on row norms only.
◮ Simple “counter example”:
A =
√ne1 1 √ne1
· · ·
1 √ne1 1 √ne2
13
[Drineas/Mahoney/Muthukrishnan’2007]: Let Vk contain k dominant right singular vectors of A. Setting pℓ = Vk(ℓ, :)2
2/k,
ℓ = 1, . . . , n and sampling O(k2(log 1/δ)/ε2) columns1 yields A − QQTAF ≤ (1 + ε)A − Tk(A)F with probability 1 − δ. Relative error bound! CUR decomposition can be obtained by applying ideas to rows and columns (yielding R and C, respectively) and choosing U appropriately.
1There are variants that improve this to O(k log k log(1/δ)/ε2).
14