10-701 Recita,on 4: Op,miza,on Dougal Sutherland - - PowerPoint PPT Presentation

10 701 recita on 4 op miza on
SMART_READER_LITE
LIVE PREVIEW

10-701 Recita,on 4: Op,miza,on Dougal Sutherland - - PowerPoint PPT Presentation

10-701 Recita,on 4: Op,miza,on Dougal Sutherland 10/8/2013 Mo,va,on Much of the ,me in ML/stats, were finding the best model to fit our


slide-1
SLIDE 1

10-­‑701 ¡Recita,on ¡4: ¡ Op,miza,on ¡

Dougal ¡Sutherland ¡ 10/8/2013 ¡ ¡

slide-2
SLIDE 2

Mo,va,on ¡

  • Much ¡of ¡the ¡,me ¡in ¡ML/stats, ¡we’re ¡finding ¡

the ¡best ¡model ¡to ¡fit ¡our ¡data ¡

– Best ¡discrimina,ve ¡ – Best ¡genera,ve ¡model: ¡MLE, ¡MAP, ¡… ¡

  • How ¡we ¡do ¡that: ¡op,miza,on. ¡
  • When ¡we ¡can: ¡convex ¡op,miza,on. ¡

arg min

models M n

X

i=1

`(xi; M) + penalty(M)

slide-3
SLIDE 3

Analy,c ¡minima ¡

  • Set ¡gradient ¡to ¡zero ¡and ¡solve ¡

Jλ(β) = 1 2kXβ yk2

2 + 1

2λkβk2

2

slide-4
SLIDE 4

Gradient ¡descent ¡

  • Start ¡at ¡some ¡point, ¡follow ¡the ¡gradient ¡

towards ¡(a) ¡minimum ¡ ¡ ¡ x x0 while termination conditions don’t hold do x x ηrf(x) end while

slide-5
SLIDE 5

Gradient ¡descent ¡interpreta,on ¡

f(y) ⇡ f(x) + rf(x)T (y x) | {z }

linear approximation to f

+ 1 2η ky xk2

2

| {z }

proximity to x

Approximate ¡the ¡func,on ¡with ¡a ¡quadra,c: ¡

slide-6
SLIDE 6

Choosing ¡the ¡step ¡size ¡

slide-7
SLIDE 7

Backtracking ¡

  • Fix ¡a ¡backoff ¡parameter ¡0 ¡< ¡β ¡< ¡1 ¡
  • At ¡each ¡itera,on: ¡

– Start ¡with ¡η ¡= ¡1 ¡ – While ¡

  • Back ¡off ¡ ¡η ¡= ¡β ¡η ¡

f (x ηrf(x)) > f(x) η 2krf(x)k2

slide-8
SLIDE 8

How ¡to ¡terminate ¡

  • When ¡change ¡in ¡iterates ¡is ¡small ¡
  • When ¡gradient ¡is ¡small ¡
  • When ¡change ¡in ¡func,on ¡value ¡is ¡small ¡
  • When ¡backtracking ¡step ¡size ¡gets ¡too ¡small ¡
  • Aaer ¡a ¡fixed ¡,me/steps ¡budget ¡
  • … ¡
slide-9
SLIDE 9

Stochas,c ¡gradient ¡“descent” ¡

  • Usually ¡we’re ¡minimizing ¡the ¡empirical ¡loss: ¡

¡ ¡

  • We ¡do ¡this ¡to ¡approximate ¡the ¡expected ¡loss: ¡ ¡

¡ ¡

  • But ¡we ¡can ¡also ¡use ¡rougher, ¡cheaper ¡approx.: ¡

1 n X

i

`(xi; M) Ex [`(x; M)] Ex [rM`(xi; M)] 1 n X

i

rM`(xi; M) `(xi; M) rM`(xi; M)

slide-10
SLIDE 10

SGD ¡

  • “Online” ¡op,miza,on ¡
  • Can ¡do ¡it ¡based ¡on ¡a ¡stream ¡of ¡samples ¡

– No ¡need ¡to ¡remember ¡old ¡ones, ¡then ¡

  • Itera,ons ¡are ¡much ¡cheaper ¡
  • Requires ¡more ¡itera,ons ¡
  • One ¡big ¡problem: ¡not ¡a ¡descent ¡method! ¡
slide-11
SLIDE 11

Minibatch ¡gradient ¡

  • Like ¡SGD, ¡but ¡calculate ¡gradients ¡over ¡a ¡subset ¡
  • f ¡training ¡points ¡instead ¡of ¡just ¡one ¡
  • Can ¡be ¡a ¡nice ¡medium ¡between ¡full ¡gradient ¡

descent ¡and ¡SGD ¡

– Not ¡a ¡descent ¡method, ¡but ¡“closer” ¡to ¡one ¡ – Itera,ons ¡more ¡expensive ¡than ¡SGD ¡ – Converges ¡faster ¡than ¡SGD ¡

slide-12
SLIDE 12

Subgradients ¡

  • When ¡your ¡op,miza,on ¡problem ¡is ¡convex ¡

but ¡not ¡differen,able ¡

  • Subgradient ¡descent: ¡

– same ¡algorithm, ¡but ¡ use ¡any ¡subgradient ¡ instead ¡of ¡the ¡ gradient ¡

  • This ¡is ¡slow. ¡
slide-13
SLIDE 13

Generalized ¡gradient ¡descent ¡

  • Objec,ve ¡is ¡the ¡sum ¡of ¡a ¡convex, ¡

differen,able ¡g ¡and ¡a ¡convex ¡h: ¡ min

x g(x) + h(x)

x proxη (x ηrg(x)) proxη(x) = arg min

z

1 2η kx zk2 + h(z)

  • e.g. ¡LASSO, ¡projected ¡gradient ¡descent ¡
slide-14
SLIDE 14

Accelerated ¡gradient ¡method ¡

  • At ¡each ¡step ¡k: ¡

¡ ¡ ¡ ¡

  • y ¡term ¡carries ¡“momentum” ¡
  • Provably ¡bejer ¡convergence ¡

– O(1/k2): ¡op,mal ¡for ¡first-­‑order ¡

y x(k−1) + k 2 k + 1 ⇣ x(k−1) x(k−2)⌘ x(k) proxηk (y ηkrg(y))

slide-15
SLIDE 15

Newton’s ¡method ¡

  • Gradient ¡descent ¡minimizes ¡

¡ ¡

  • Newton’s ¡method: ¡quadra,c ¡approxima,on ¡

¡ ¡

  • Takes ¡v. ¡few ¡itera,ons ¡for ¡v. ¡accurate ¡answer ¡

– Itera,ons ¡are ¡very ¡expensive ¡ – Diverges ¡with ¡bad ¡ini,aliza,on ¡

  • Damped ¡Newton: ¡line ¡search, ¡trust ¡region ¡

f(y) ⇡ f(x) + rf(x)T (y x) + 1 2(y x)T 1 η I(y x) f(y) ⇡ f(x) + rf(x)T (y x) + 1 2(y x)T r2f(x) (y x)

slide-16
SLIDE 16

Sort-­‑of ¡second-­‑order ¡methods ¡

  • Quasi-­‑Newton ¡methods ¡

– Approximate ¡Hessian ¡from ¡the ¡gradient ¡ – BFGS, ¡L-­‑BFGS ¡ ¡

  • Truncated ¡Newton ¡

– Par,ally ¡op,mize ¡quadra,c ¡with ¡conjugate ¡gradient ¡

slide-17
SLIDE 17

Standard ¡problem ¡forms ¡

  • Linear ¡programs ¡(LPs) ¡

¡ ¡

  • Quadra,c ¡programs ¡(QPs) ¡

¡ ¡

  • Cone ¡programs ¡

min cT x subject to Ax ≤ b, Ex = g min cT x + 1 2xT Hx subject to Ax ≤ b, Ex = g min cT x subject to Ax + b ∈ K, x ∈ L