10 701 recita on 4 op miza on
play

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


  1. 10-­‑701 ¡Recita,on ¡4: ¡ Op,miza,on ¡ Dougal ¡Sutherland ¡ 10/8/2013 ¡ ¡

  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, ¡… ¡ n X arg min ` ( x i ; M ) + penalty( M ) models M i =1 • How ¡we ¡do ¡that: ¡op,miza,on. ¡ • When ¡we ¡can: ¡convex ¡op,miza,on. ¡

  3. Analy,c ¡minima ¡ • Set ¡gradient ¡to ¡zero ¡and ¡solve ¡ J λ ( β ) = 1 2 + 1 2 k X β � y k 2 2 λ k β k 2 2

  4. Gradient ¡descent ¡ • Start ¡at ¡some ¡point, ¡follow ¡the ¡gradient ¡ towards ¡(a) ¡minimum ¡ ¡ x x 0 ¡ while termination conditions don’t hold do x x � η r f ( x ) end while

  5. Gradient ¡descent ¡interpreta,on ¡ Approximate ¡the ¡func,on ¡with ¡a ¡quadra,c: ¡ + 1 f ( y ) ⇡ f ( x ) + r f ( x ) T ( y � x ) 2 η k y � x k 2 2 | {z } | {z } linear approximation to f proximity to x

  6. Choosing ¡the ¡step ¡size ¡

  7. Backtracking ¡ • Fix ¡a ¡backoff ¡parameter ¡0 ¡< ¡β ¡< ¡1 ¡ • At ¡each ¡itera,on: ¡ – Start ¡with ¡ η ¡= ¡1 ¡ f ( x � η r f ( x )) > f ( x ) � η – While ¡ 2 kr f ( x ) k 2 • Back ¡off ¡ ¡ η ¡= ¡β ¡η ¡

  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 ¡ • … ¡

  9. Stochas,c ¡gradient ¡“descent” ¡ • Usually ¡we’re ¡minimizing ¡the ¡empirical ¡loss: ¡ ¡ 1 1 X X ` ( x i ; M ) r M ` ( x i ; M ) ¡ n n i i • We ¡do ¡this ¡to ¡approximate ¡the ¡expected ¡loss: ¡ ¡ ¡ E x [ r M ` ( x i ; M )] E x [ ` ( x ; M )] ¡ • But ¡we ¡can ¡also ¡use ¡rougher, ¡cheaper ¡approx.: ¡ ` ( x i ; M ) r M ` ( x i ; M )

  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! ¡

  11. Minibatch ¡gradient ¡ • Like ¡SGD, ¡but ¡calculate ¡gradients ¡over ¡a ¡subset ¡ of ¡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 ¡

  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. ¡

  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 � η r g ( x )) 1 2 η k x � z k 2 + h ( z ) prox η ( x ) = arg min z • e.g. ¡LASSO, ¡projected ¡gradient ¡descent ¡

  14. Accelerated ¡gradient ¡method ¡ • At ¡each ¡step ¡ k : ¡ ¡ y x ( k − 1) + k � 2 ⇣ x ( k − 1) � x ( k − 2) ⌘ ¡ k + 1 ¡ x ( k ) prox η k ( y � η k r g ( y )) ¡ • y ¡term ¡carries ¡“momentum” ¡ • Provably ¡bejer ¡convergence ¡ – O(1/ k 2 ): ¡op,mal ¡for ¡first-­‑order ¡

  15. Newton’s ¡method ¡ • Gradient ¡descent ¡minimizes ¡ ¡ f ( y ) ⇡ f ( x ) + r f ( x ) T ( y � x ) + 1 2( y � x ) T 1 η I ( y � x ) ¡ • Newton’s ¡method: ¡quadra,c ¡approxima,on ¡ f ( y ) ⇡ f ( x ) + r f ( x ) T ( y � x ) + 1 ¡ 2( y � x ) T r 2 f ( x ) ( y � x ) ¡ • 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 ¡

  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 ¡

  17. Standard ¡problem ¡forms ¡ • Linear ¡programs ¡(LPs) ¡ ¡ min c T x subject to Ax ≤ b, Ex = g ¡ • Quadra,c ¡programs ¡(QPs) ¡ min c T x + 1 ¡ 2 x T Hx subject to Ax ≤ b, Ex = g ¡ • Cone ¡programs ¡ min c T x subject to Ax + b ∈ K, x ∈ L

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend