reinforcement learning
play

Reinforcement Learning++ Emma Brunskill (today) Ariel - PowerPoint PPT Presentation

Reinforcement Learning++ Emma Brunskill (today) Ariel Procaccia 1 Recall MDPs: What You Should Know DefiniGon How to define for a problem Value


  1. Reinforcement ¡Learning++ ¡ Emma ¡Brunskill ¡(today) ¡ Ariel ¡Procaccia ¡ 1 ¡

  2. Recall ¡MDPs: ¡What ¡You ¡Should ¡Know ¡ • DefiniGon ¡ • How ¡to ¡define ¡for ¡a ¡problem ¡ • Value ¡iteraGon ¡and ¡policy ¡iteraGon ¡ – How ¡to ¡implement ¡ – Convergence ¡guarantees ¡ – ComputaGonal ¡complexity ¡

  3. Reinforcement ¡Learning ¡ TransiGon ¡ Model ? ¡ AcGon ¡ State ¡ Reward ¡model ? ¡ Agent ¡ Goal: ¡Maximize ¡expected ¡sum ¡of ¡future ¡rewards ¡ ¡

  4. Recap ¡of ¡Last ¡Time ¡ • Model-­‑based ¡RL ¡when ¡select ¡acGons ¡randomly ¡ – EsGmate ¡a ¡model ¡of ¡the ¡dynamics ¡and ¡rewards ¡ from ¡data ¡(e.g. ¡T(s1|s2,a2) ¡~ ¡0.3) ¡ – Do ¡MDP ¡planning ¡given ¡those ¡esGmated ¡models ¡ • Q-­‑learning ¡ – No ¡model ¡of ¡dynamics ¡and ¡rewards ¡ – Directly ¡esGmate ¡state-­‑acGon ¡value ¡funcGon ¡ 4 ¡

  5. Q-­‑Learning ¡ • At ¡each ¡step, ¡for ¡current ¡state ¡s ¡and ¡acGon ¡taken ¡ – Observe ¡r ¡and ¡s’ ¡ ¡ – Update ¡Q(s,a) ¡ ¡ sampleQ ( s , a ) = R ( s , a , s ') + γ max a ' Q ( s ', a ') Q ( s , a ) = (1 − α ) Q ( s , a ) + α * sampleQ ( s , a ) • IntuiGon: ¡using ¡samples ¡to ¡approximate ¡ – Future ¡rewards ¡ – ExpectaGon ¡over ¡next ¡states ¡due ¡to ¡transiGon ¡model ¡ uncertainty ¡ ¡

  6. Q-­‑Learning ¡ProperGes ¡ • If ¡acGng ¡randomly, ¡Q-­‑learning ¡converges* ¡to ¡ opGmal ¡state—acGon ¡values, ¡and ¡also ¡ therefore ¡finds ¡opGmal ¡policy ¡ • Off-­‑policy ¡learning ¡ – Can ¡act ¡in ¡one ¡way ¡ – But ¡learning ¡values ¡of ¡another ¡policy ¡(the ¡opGmal ¡ one!) ¡

  7. Towards ¡Gathering ¡High ¡Reward ¡ • Fortunately, ¡acGng ¡randomly ¡is ¡sufficient, ¡but ¡ not ¡necessary, ¡to ¡learn ¡the ¡opGmal ¡values ¡and ¡ policy ¡

  8. How ¡to ¡Act? ¡ • IniGalize ¡s ¡to ¡a ¡starGng ¡state ¡ • IniGalize ¡Q(s,a) ¡values ¡ ¡ • For ¡t=1,2,… ¡ – Choose ¡a ¡= ¡argmax ¡Q(s,a) ¡ – Observe ¡s’,r(s,a,s’) ¡ ¡ – Update/Compute ¡Q ¡values ¡

  9. Is ¡this ¡Approach ¡Guaranteed ¡to ¡Learn ¡ OpGmal ¡Policy? ¡ • IniGalize ¡s ¡to ¡a ¡starGng ¡state ¡ • IniGalize ¡Q(s,a) ¡values ¡ ¡ • For ¡t=1,2,… ¡ – Choose ¡a ¡= ¡argmax ¡Q(s,a) ¡ – Observe ¡s’,r(s,a,s’) ¡ ¡ – Update/Compute ¡Q ¡values ¡(using ¡model-­‑based ¡or ¡Q-­‑learning ¡ approach) ¡ ¡ 1. ¡Yes ¡ ¡ ¡ ¡2. ¡No ¡ ¡ ¡ ¡3. ¡Not ¡sure ¡

  10. To ¡Explore ¡or ¡Exploit? ¡ Slide adapted from Klein and Abbeel Drawing ¡by ¡Ketrina ¡Yim ¡

  11. Simple ¡Approach: ¡E-­‑greedy ¡ • With ¡probability ¡1-­‑e ¡ – Choose ¡argmax a ¡Q(s,a) ¡ • With ¡probability ¡e ¡ – Select ¡random ¡acGon ¡ ¡ • Guaranteed ¡to ¡compute ¡opGmal ¡policy ¡ • But ¡even ¡aker ¡millions ¡of ¡steps ¡sGll ¡won’t ¡always ¡be ¡ following ¡policy ¡compute ¡(the ¡argmax ¡Q(s,a)) ¡

  12. Greedy ¡in ¡Limit ¡of ¡Infinite ¡ExploraGon ¡ (GLIE) ¡ • E-­‑Greedy ¡approach ¡ • But ¡decay ¡epsilon ¡over ¡Gme ¡ • Eventually ¡will ¡be ¡following ¡opGmal ¡policy ¡ almost ¡all ¡the ¡Gme ¡ ¡

  13. How ¡should ¡we ¡evaluate ¡the ¡performance ¡of ¡an ¡ algorithm? ¡ 13 ¡

  14. How ¡should ¡we ¡evaluate ¡the ¡performance ¡of ¡an ¡ algorithm? ¡ ¡ -­‑ ComputaGonal ¡efficiency ¡ -­‑ How ¡much ¡reward ¡gathered ¡under ¡algorithm? ¡ 14 ¡

  15. The ¡Speed ¡of ¡Learning ¡and ¡ Speeding ¡Learning ¡ 15 ¡

  16. ObjecGves ¡for ¡an ¡RL ¡Algorithm ¡ • AsymptoGc ¡guarantees ¡ – In ¡limit ¡converge ¡to ¡a ¡policy ¡idenGcal ¡to ¡the ¡opGmal ¡ policy ¡if ¡knew ¡unknown ¡model ¡parameters ¡ 16 ¡

  17. ObjecGves ¡for ¡an ¡RL ¡Algorithm ¡ • AsymptoGc ¡guarantees ¡ – In ¡limit ¡converge ¡to ¡a ¡policy ¡idenGcal ¡to ¡the ¡opGmal ¡ policy ¡if ¡knew ¡unknown ¡model ¡parameters ¡ – Q-­‑learning! ¡(under ¡what ¡condiGons?) ¡ • Probably ¡Approximately ¡Correct ¡ – On ¡all ¡but ¡finite ¡number ¡of ¡samples, ¡choose ¡acGon ¡ whose ¡expected ¡reward ¡is ¡close ¡to ¡expected ¡reward ¡ of ¡acGon ¡take ¡if ¡knew ¡model ¡parameters ¡ – E 3 ¡(Kearns ¡& ¡Singh), ¡R-­‑MAX ¡(Brafman ¡& ¡Tennenholtz) ¡ 17 ¡

  18. Model-­‑Based ¡RL ¡ • Given ¡data ¡seen ¡so ¡far ¡ • Build ¡an ¡explicit ¡model ¡of ¡the ¡MDP ¡ • Compute ¡policy ¡for ¡it ¡ • Select ¡acGon ¡for ¡current ¡state ¡given ¡policy, ¡ observe ¡next ¡state ¡and ¡reward ¡ • Repeat ¡ 18 ¡

  19. R-­‑max ¡(Brafman ¡& ¡Tennenholtz) ¡ … S2 ¡ S1 ¡ ¡ ¡ ¡ ¡ ¡ ¡

  20. R-­‑max ¡is ¡Model-­‑based ¡RL ¡ Think ¡hard: ¡esGmate ¡models ¡& ¡compute ¡policies ¡ Act ¡in ¡world ¡ ¡ Rmax ¡leverages ¡opGmism ¡under ¡uncertainty! ¡

  21. R-­‑max ¡Algorithm: ¡ ¡ IniGalize: ¡Define ¡“Known” ¡MDP ¡ Reward ¡ ¡ ¡ S1 S2 S3 S4 … S1 S2 S3 S4 … ¡ ¡ ¡ ¡ R max R max R max R max U U U U Known/ ¡ U U U U R max R max R max R max Unknown ¡ U U U U R max R max R max R max U U U U R max R max R max R max In ¡the ¡“known” ¡MDP, ¡ S1 S2 S3 S4 … ¡ ¡ any ¡unknown ¡(s,a) ¡pair ¡ 0 0 0 0 TransiGon ¡ has ¡its ¡dynamics ¡set ¡as ¡ ¡ 0 0 0 0 Counts ¡ a ¡self ¡loop ¡& ¡ 0 0 0 0 ¡reward ¡= ¡Rmax ¡ 0 0 0 0

  22. R-­‑max ¡Algorithm ¡ Plan ¡in ¡known ¡MDP ¡

  23. R-­‑max: ¡Planning ¡ • Compute ¡opGmal ¡policy ¡π known ¡for ¡ “ known ” ¡MDP ¡

  24. Exercise: ¡What ¡Will ¡IniGal ¡Value ¡of ¡Q(s,a) ¡be ¡for ¡ each ¡(s,a) ¡Pair ¡in ¡the ¡Known ¡MDP? ¡What ¡is ¡the ¡ Policy? ¡ Reward ¡ ¡ ¡ S1 S2 S3 S4 … S1 S2 S3 S4 … ¡ ¡ ¡ ¡ R max R max R max R max U U U U Known/ ¡ U U U U R max R max R max R max Unknown ¡ U U U U R max R max R max R max U U U U R max R max R max R max In ¡the ¡“known” ¡MDP, ¡ S1 S2 S3 S4 … ¡ ¡ any ¡unknown ¡(s,a) ¡pair ¡ 0 0 0 0 TransiGon ¡ has ¡its ¡dynamics ¡set ¡as ¡ ¡ 0 0 0 0 Counts ¡ a ¡self ¡loop ¡& ¡ 0 0 0 0 ¡reward ¡= ¡Rmax ¡ 0 0 0 0

  25. R-­‑max ¡Algorithm ¡ Act ¡using ¡ ¡ policy ¡ Plan ¡in ¡known ¡MDP ¡ • Given ¡opGmal ¡policy ¡π known ¡for ¡ “ known ” ¡MDP ¡ • Take ¡best ¡acGon ¡for ¡current ¡state ¡π known (s), ¡ transiGon ¡to ¡new ¡state ¡s’ ¡and ¡get ¡reward ¡r ¡

  26. R-­‑max ¡Algorithm ¡ Act ¡using ¡ ¡ policy ¡ Plan ¡in ¡known ¡MDP ¡ Update ¡state-­‑acGon ¡ counts ¡

  27. Update ¡Known ¡MDP ¡ Reward ¡ ¡ ¡ S2 S2 S3 S4 … S2 S2 S3 S4 … ¡ ¡ ¡ ¡ R max R max R max R max U U U U Known/ ¡ U U U U R max R max R max R max Unknown ¡ U U U U R max R max R max R max U U U U R max R max R max R max S2 S2 S3 S4 … ¡ ¡ 0 0 0 0 Increment ¡counts ¡for ¡ TransiGon ¡ 0 0 1 0 state-­‑acGon ¡tuple ¡ Counts ¡ 0 0 0 0 0 0 0 0

  28. Update ¡Known ¡MDP ¡ Reward ¡ ¡ ¡ S2 S2 S3 S4 … S2 S2 S3 S4 … ¡ ¡ ¡ ¡ R max R max R max R max U U U U Known/ ¡ U U K U R max R max R R max Unknown ¡ U U U U R max R max R max R max U U U U R max R max R max R max If ¡counts ¡for ¡(s,a) ¡> ¡N, ¡ S2 S2 S3 S4 … ¡ ¡ (s,a) ¡becomes ¡known: ¡ 3 3 4 3 use ¡observed ¡data ¡to ¡ TransiGon ¡ 2 4 5 0 Counts ¡ esGmate ¡transiGon ¡& ¡ 4 0 4 4 reward ¡model ¡ for ¡(s,a) ¡ 2 2 4 1 when ¡planning ¡

  29. EsGmaGng ¡MDP ¡Model ¡for ¡a ¡(s,a) ¡ Pair ¡Given ¡Data ¡ • TransiGon ¡model ¡esGmaGon ¡ ¡ • Reward ¡model ¡esGmaGon ¡ 29 ¡

  30. R-­‑max ¡Algorithm ¡ Act ¡using ¡ ¡ policy ¡ Plan ¡in ¡known ¡MDP ¡ Update ¡state-­‑acGon ¡ counts ¡ Update ¡known ¡MDP ¡ dynamics ¡& ¡reward ¡ models ¡

  31. R-­‑max ¡Behavior ¡ 31 ¡

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