Optimization in the Big Data Regime Sham M. Kakade Machine Learning - - PowerPoint PPT Presentation

optimization in the big data regime sham m kakade
SMART_READER_LITE
LIVE PREVIEW

Optimization in the Big Data Regime Sham M. Kakade Machine Learning - - PowerPoint PPT Presentation

Optimization in the Big Data Regime Sham M. Kakade Machine Learning for Big Data CSE547/STAT548 University of Washington S. M. Kakade (UW) Optimization for Big data 1 / 18 Announcements... HW2 due Mon. Work on your project milestones


slide-1
SLIDE 1

Optimization in the “Big Data” Regime Sham M. Kakade

Machine Learning for Big Data CSE547/STAT548 University of Washington

  • S. M. Kakade (UW)

Optimization for Big data 1 / 18

slide-2
SLIDE 2

Announcements...

HW2 due Mon. Work on your project milestones

read/related work summary some empirical work

Today: Review: discuss classical optimization New: How do we optimize in the “big data” regime, with large sample sizes and large dimension? Bridge classical to modern optimization.

  • S. M. Kakade (UW)

Optimization for Big data 2 / 18

slide-3
SLIDE 3

Machine Learning and the Big Data Regime...

goal: find a d-dim parameter vector which minimizes the loss on n training examples. have n training examples (x1, y1), . . . (xn, yn) have parametric a classifier hθ(x, w), where w is a d dimensional vector. min

w L(w) where L(w) =

  • i

loss(h(xi, w), yi) “Big Data Regime”: How do you optimize this when n and d are large? memory? parallelization? Can we obtain linear time algorithms to find an ǫ-accurate solution? i.e. find ˆ w so that L( ˆ w) − min

w L(w) ≤ ǫ

  • S. M. Kakade (UW)

Optimization for Big data 3 / 18

slide-4
SLIDE 4

Plan:

Goal: algorithms to get fixed target accuracy ǫ. Review: classical optimization viewpoints A modern view: can be bridge classical optimization to modern problems?

Dual Coordinate Descent Methods Stochastic Variance Reduced Gradient method (SVRG)

  • S. M. Kakade (UW)

Optimization for Big data 4 / 18

slide-5
SLIDE 5

Abstraction: Least Squares

min

w L(w) where L(w) = n

  • i=1

(w · xi − yi)2 + λw2 How much computation time is required to to get ǫ accuracy? n points, d dimensions. “Big Data Regime”: How do you optimize this when n and d are large? More general case: Optimize sums of convex (or non-convex functions?

some guarantees will still hold

Aside: think of x as a large feature representation.

  • S. M. Kakade (UW)

Optimization for Big data 5 / 18

slide-6
SLIDE 6

Review: Direct Solution

min

w L(w) where L(w) = n

  • i=1

(w · xi − yi)2 + λw2 solution: w = (X ⊤X + λI)−1X ⊤Y where X be the n × d matrix whose rows are xi, and Y is an n-dim vector. numerical solution: the “backslash” implementation. time complexity: O(nd2) and memory O(d2) Not feasible due to both time and memory.

  • S. M. Kakade (UW)

Optimization for Big data 6 / 18

slide-7
SLIDE 7

Review: Gradient Descent (and Conjugate GD)

min

w L(w) where L(w) = n

  • i=1

(w · xi − yi)2 + λw2 n points, d dimensions, λmax, λmin are max and min eigs. of “design matrix” 1

n

  • i xix⊤

i

# iterations and computation time to get ǫ accuracy:

Gradient Descent (GD): λmax λmin log 1/ǫ, λmax λmin nd log 1/ǫ Conjugate Gradient Descent:

  • λmax

λmin log 1/ǫ,

  • λmax

λmin nd log 1/ǫ

memory: O(d) Better runtime and memory, but still costly.

  • S. M. Kakade (UW)

Optimization for Big data 7 / 18

slide-8
SLIDE 8

Review: Stochastic Gradient Descent (SGD)

SGD update rule: at each time t,

sample a point (xi, yi) w ← w − η(w · xi − yi)xi

  • S. M. Kakade (UW)

Optimization for Big data 8 / 18

slide-9
SLIDE 9

Review: Stochastic Gradient Descent (SGD)

SGD update rule: at each time t,

sample a point (xi, yi) w ← w − η(w · xi − yi)xi

  • S. M. Kakade (UW)

Optimization for Big data 8 / 18

slide-10
SLIDE 10

Review: Stochastic Gradient Descent (SGD)

SGD update rule: at each time t,

sample a point (xi, yi) w ← w − η(w · xi − yi)xi

Problem: even if w = w∗, the update changes w. Rate: convergence rate is O(1/ǫ), with decaying η simple algorithm, light on memory, but poor convergence rate

  • S. M. Kakade (UW)

Optimization for Big data 8 / 18

slide-11
SLIDE 11

Review: Stochastic Gradient Descent

λmin is the min eig. of 1

n

  • i xix⊤

i

Suppose gradients are bounded by B. To get ǫ accuracy:

# iterations to get ǫ-accuracy: B2 λminǫ Computation time to get ǫ-accuracy: dB2 λminǫ

  • S. M. Kakade (UW)

Optimization for Big data 9 / 18

slide-12
SLIDE 12

Regression in the big data regime?

min

w L(w)

How much computation time is required to to get ǫ accuracy? “Big Data Regime”: How do you optimize this when n and d are large?

Can we ’fix’ the instabilities of SGD?

Let’s look at (regularized) linear regression.

Convex optimization: All results can be generalized to smooth+strongly convex loss functions. Non-convex optimization: some ideas generalize.

  • S. M. Kakade (UW)

Optimization for Big data 10 / 18

slide-13
SLIDE 13

Duality (without Duality)

w = (X ⊤X + λI)−1X ⊤Y = X ⊤(XX ⊤ + λI)−1Y := 1 λX ⊤α where α = (I + XX ⊤/λ)−1Y. idea: let’s compute the n-dim vector α. let’s do this with coordinate ascent

  • S. M. Kakade (UW)

Optimization for Big data 11 / 18

slide-14
SLIDE 14

SDCA: stochastic dual coordinate ascent

G(α1, α2, . . . αn) = 1 2α⊤(I + XX ⊤/λ)α − Y ⊤α the minimizer of G(α) is α = (I + XX ⊤/λ)−1Y SDCA:

start with α = 0. choose coordinate i randomly, and update: αi = argminzG(α1, . . . αi−1, z, . . . , αn) easy to do as we touch just one datapoint. return w = 1

λX ⊤α.

  • S. M. Kakade (UW)

Optimization for Big data 12 / 18

slide-15
SLIDE 15

SDCA: the algorithm

G(α1, α2, . . . αn) = 1 2α⊤(I + XX ⊤/λ)α − Y ⊤α start with α = 0, w = 1

λX ⊤α.

1

choose coordinate i randomly, and compute difference: ∆αi = (yi − w · xi) − αi 1 + xi2/λ

2

update: αi ← αi + ∆αi, w ← w + 1 λxi · ∆αi

return w = 1

λX ⊤α.

  • S. M. Kakade (UW)

Optimization for Big data 13 / 18

slide-16
SLIDE 16

Guarantees: speedups for the big data regime

n points, d dimensions, λav average eigenvalue Computation time to get ǫ accuracy gradient descent: (Shalev-Shwartz & Zhang ’12)

GD vs SDCA: λmax λmin n d log 1/ǫ →

  • n + d λav

λmin

  • d log 1/ǫ

conjugate GD vs acceleration+SDCA. One can accelerate SDCA as well. (Frosting, Ge, K., Sidford, 2015))

  • S. M. Kakade (UW)

Optimization for Big data 14 / 18

slide-17
SLIDE 17

Comparisons to GD

both algorithms touch one data point at a time, with same computational cost per iteration. SDCA has “learning rate” which adaptive to the data point. GD has convergence rate of 1/ǫ and SDCA has log 1/ǫ convergence rate. memory: SDCA: O(n + d), SGD: O(d) SDCA: can touch points in any order.

  • S. M. Kakade (UW)

Optimization for Big data 15 / 18

slide-18
SLIDE 18

SDCA advantages/disadvantages

What about more general convex problems? e.g. min

w L(w) where L(w) =

  • i

loss(h(xi, w), yi)

the basic idea (formalized with duality) is pretty general for convex loss(·). works very well in practice.

memory: SDCA needs O(n + d) memory, while SGD is only O(d). What about an algorithm for non-convex problems?

SDCA seems heavily tied to the convex case. would an algo that is highly accurate in the convex case and sensible in the non-convex case.

  • S. M. Kakade (UW)

Optimization for Big data 16 / 18

slide-19
SLIDE 19

(another idea) Stochastic Variance Reduced Gradient (SVRG)

1

exact gradient computation: at stage s, using ws, compute: ∇L( ws) = 1 n

n

  • i=1

∇loss( ws, (xi, yi))

2

corrected SGD: initialize w ←

  • ws. for m steps,

sample a point (x, y) w ← w − η

  • ∇loss(w, (x, y))−∇loss(

ws, (x, y)) + ∇L( ws)

  • 3

update and repeat: ws+1 ← w.

  • S. M. Kakade (UW)

Optimization for Big data 17 / 18

slide-20
SLIDE 20

(another idea) Stochastic Variance Reduced Gradient (SVRG)

1

exact gradient computation: at stage s, using ws, compute: ∇L( ws) = 1 n

n

  • i=1

∇loss( ws, (xi, yi))

2

corrected SGD: initialize w ←

  • ws. for m steps,

sample a point (x, y) w ← w − η

  • ∇loss(w, (x, y))−∇loss(

ws, (x, y)) + ∇L( ws)

  • 3

update and repeat: ws+1 ← w. Two ideas: If w = w∗, then no update. unbiased updates: blue term is mean 0.

  • S. M. Kakade (UW)

Optimization for Big data 17 / 18

slide-21
SLIDE 21

Guarantees of SVRG

n points, d dimensions, λav average eigenvalue Computation time to get ǫ accuracy gradient descent: (Johnson & Zhang ’13)

GD vs SDCA: λmax λmin n d log 1/ǫ →

  • n + d λav

λmin

  • d log 1/ǫ

conjugate GD vs ??

  • λmax

λmin n d log 1/ǫ → ?? memory: O(d)

  • S. M. Kakade (UW)

Optimization for Big data 18 / 18