non determinis c search cs 188 ar ficial intelligence
play

Non-Determinis)c Search CS 188: Ar)ficial Intelligence - PowerPoint PPT Presentation

Non-Determinis)c Search CS 188: Ar)ficial Intelligence Markov Decision Processes September 28, 2015 [These slides were created by Dan Klein and Pieter


  1. Non-­‑Determinis)c ¡Search ¡ CS ¡188: ¡Ar)ficial ¡Intelligence ¡ ¡ Markov ¡Decision ¡Processes ¡ September ¡28, ¡2015 ¡ [These ¡slides ¡were ¡created ¡by ¡Dan ¡Klein ¡and ¡Pieter ¡Abbeel ¡for ¡CS188 ¡Intro ¡to ¡AI ¡at ¡UC ¡Berkeley. ¡ ¡All ¡CS188 ¡materials ¡are ¡available ¡at ¡hMp://ai.berkeley.edu.] ¡ Example: ¡Grid ¡World ¡ Grid ¡World ¡Ac)ons ¡ Determinis)c ¡Grid ¡World ¡ Stochas)c ¡Grid ¡World ¡ § A ¡maze-­‑like ¡problem ¡ § The ¡agent ¡lives ¡in ¡a ¡grid ¡ Walls ¡block ¡the ¡agent’s ¡path ¡ § § Noisy ¡movement: ¡ac)ons ¡do ¡not ¡always ¡go ¡as ¡planned ¡ § 80% ¡of ¡the ¡)me, ¡the ¡ac)on ¡North ¡takes ¡the ¡agent ¡North ¡ ¡ (if ¡there ¡is ¡no ¡wall ¡there) ¡ § 10% ¡of ¡the ¡)me, ¡North ¡takes ¡the ¡agent ¡West; ¡10% ¡East ¡ § If ¡there ¡is ¡a ¡wall ¡in ¡the ¡direc)on ¡the ¡agent ¡would ¡have ¡ been ¡taken, ¡the ¡agent ¡stays ¡put ¡ § The ¡agent ¡receives ¡rewards ¡each ¡)me ¡step ¡ § Small ¡“living” ¡reward ¡each ¡step ¡(can ¡be ¡nega)ve) ¡ § Big ¡rewards ¡come ¡at ¡the ¡end ¡(good ¡or ¡bad) ¡ § Goal: ¡maximize ¡sum ¡of ¡rewards ¡ 1

  2. Markov ¡Decision ¡Processes ¡ Video ¡of ¡Demo ¡Gridworld ¡Manual ¡Intro ¡ § An ¡MDP ¡is ¡defined ¡by: ¡ § A ¡set ¡of ¡states ¡s ¡ ∈ ¡S ¡ § A ¡set ¡of ¡ac)ons ¡a ¡ ∈ ¡A ¡ § A ¡transi)on ¡func)on ¡T(s, ¡a, ¡s’) ¡ § Probability ¡that ¡a ¡from ¡s ¡leads ¡to ¡s’, ¡i.e., ¡P(s’| ¡s, ¡a) ¡ § Also ¡called ¡the ¡model ¡or ¡the ¡dynamics ¡ § A ¡reward ¡func)on ¡R(s, ¡a, ¡s’) ¡ ¡ § Some)mes ¡just ¡R(s) ¡or ¡R(s’) ¡ § A ¡start ¡state ¡ § Maybe ¡a ¡terminal ¡state ¡ § MDPs ¡are ¡non-­‑determinis)c ¡search ¡problems ¡ § One ¡way ¡to ¡solve ¡them ¡is ¡with ¡expec)max ¡search ¡ § We’ll ¡have ¡a ¡new ¡tool ¡soon ¡ [Demo ¡– ¡gridworld ¡manual ¡intro ¡(L8D1)] ¡ What ¡is ¡Markov ¡about ¡MDPs? ¡ Policies ¡ § “Markov” ¡generally ¡means ¡that ¡given ¡the ¡present ¡state, ¡the ¡ § In ¡determinis)c ¡single-­‑agent ¡search ¡problems, ¡ future ¡and ¡the ¡past ¡are ¡independent ¡ we ¡wanted ¡an ¡op)mal ¡plan, ¡or ¡sequence ¡of ¡ ac)ons, ¡from ¡start ¡to ¡a ¡goal ¡ § For ¡Markov ¡decision ¡processes, ¡“Markov” ¡means ¡ac)on ¡ outcomes ¡depend ¡only ¡on ¡the ¡current ¡state ¡ § For ¡MDPs, ¡we ¡want ¡an ¡op)mal ¡policy ¡ π *: ¡S ¡→ ¡A ¡ § A ¡policy ¡ π ¡gives ¡an ¡ac)on ¡for ¡each ¡state ¡ § An ¡op)mal ¡policy ¡is ¡one ¡that ¡maximizes ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ expected ¡u)lity ¡if ¡followed ¡ Andrey ¡Markov ¡ § An ¡explicit ¡policy ¡defines ¡a ¡reflex ¡agent ¡ (1856-­‑1922) ¡ Op)mal ¡policy ¡when ¡R(s, ¡a, ¡s’) ¡= ¡-­‑0.03 ¡ ¡ for ¡all ¡non-­‑terminals ¡s ¡ § Expec)max ¡didn’t ¡compute ¡en)re ¡policies ¡ § This ¡is ¡just ¡like ¡search, ¡where ¡the ¡successor ¡func)on ¡could ¡only ¡ depend ¡on ¡the ¡current ¡state ¡(not ¡the ¡history) ¡ § It ¡computed ¡the ¡ac)on ¡for ¡a ¡single ¡state ¡only ¡ ¡ 2

  3. Op)mal ¡Policies ¡ Example: ¡Racing ¡ R(s) ¡= ¡-­‑0.01 ¡ R(s) ¡= ¡-­‑0.03 ¡ R(s) ¡= ¡-­‑0.4 ¡ R(s) ¡= ¡-­‑2.0 ¡ Example: ¡Racing ¡ Racing ¡Search ¡Tree ¡ § A ¡robot ¡car ¡wants ¡to ¡travel ¡far, ¡quickly ¡ § Three ¡states: ¡Cool, ¡Warm, ¡Overheated ¡ § Two ¡ac)ons: ¡ Slow , ¡ Fast ¡ 0.5 ¡ ¡ +1 ¡ ¡ § Going ¡faster ¡gets ¡double ¡reward ¡ 1.0 ¡ ¡ Fast ¡ Slow ¡ -­‑10 ¡ +1 ¡ ¡ 0.5 ¡ ¡ Warm ¡ Slow ¡ Fast ¡ 0.5 ¡ ¡ +2 ¡ ¡ Cool ¡ 0.5 ¡ ¡ Overheated ¡ +1 ¡ ¡ 1.0 ¡ ¡ +2 ¡ ¡ 3

  4. MDP ¡Search ¡Trees ¡ U)li)es ¡of ¡Sequences ¡ § Each ¡MDP ¡state ¡projects ¡an ¡expec)max-­‑like ¡search ¡tree ¡ s ¡ s ¡is ¡a ¡ state ¡ a ¡ (s, ¡a) ¡is ¡a ¡ q-­‑ s, ¡a ¡ state ¡ (s,a,s ’ ) ¡called ¡a ¡ transi-on ¡ T(s,a,s ’ ) ¡= ¡P(s ’ |s,a) ¡ s,a,s ’ ¡ R(s,a,s ’ ) ¡ s ’ ¡ U)li)es ¡of ¡Sequences ¡ Discoun)ng ¡ § It’s ¡reasonable ¡to ¡maximize ¡the ¡sum ¡of ¡rewards ¡ § What ¡preferences ¡should ¡an ¡agent ¡have ¡over ¡reward ¡sequences? ¡ § It’s ¡also ¡reasonable ¡to ¡prefer ¡rewards ¡now ¡to ¡rewards ¡later ¡ § One ¡solu)on: ¡values ¡of ¡rewards ¡decay ¡exponen)ally ¡ § More ¡or ¡less? ¡ [1, ¡2, ¡2] ¡ ¡or ¡ [2, ¡3, ¡4] ¡ § Now ¡or ¡later? ¡ [0, ¡0, ¡1] ¡ ¡or ¡ [1, ¡0, ¡0] ¡ Worth ¡Now ¡ Worth ¡Next ¡Step ¡ Worth ¡In ¡Two ¡Steps ¡ 4

  5. Discoun)ng ¡ Sta)onary ¡Preferences ¡ § Theorem: ¡if ¡we ¡assume ¡sta)onary ¡preferences: ¡ § How ¡to ¡discount? ¡ § Each ¡)me ¡we ¡descend ¡a ¡level, ¡we ¡ mul)ply ¡in ¡the ¡discount ¡once ¡ § Why ¡discount? ¡ § Sooner ¡rewards ¡probably ¡do ¡have ¡ higher ¡u)lity ¡than ¡later ¡rewards ¡ § Also ¡helps ¡our ¡algorithms ¡converge ¡ § Then: ¡there ¡are ¡only ¡two ¡ways ¡to ¡define ¡u)li)es ¡ § Example: ¡discount ¡of ¡0.5 ¡ § Addi)ve ¡u)lity: ¡ § U([1,2,3]) ¡= ¡1*1 ¡+ ¡0.5*2 ¡+ ¡0.25*3 ¡ § U([1,2,3]) ¡< ¡U([3,2,1]) ¡ § Discounted ¡u)lity: ¡ Quiz: ¡Discoun)ng ¡ Infinite ¡U)li)es?! ¡ § Problem: ¡What ¡if ¡the ¡game ¡lasts ¡forever? ¡ ¡Do ¡we ¡get ¡infinite ¡rewards? ¡ § Given: ¡ § Solu)ons: ¡ § Ac)ons: ¡East, ¡West, ¡and ¡Exit ¡(only ¡available ¡in ¡exit ¡states ¡a, ¡e) ¡ § Finite ¡horizon: ¡(similar ¡to ¡depth-­‑limited ¡search) ¡ § Transi)ons: ¡determinis)c ¡ § Terminate ¡episodes ¡aver ¡a ¡fixed ¡T ¡steps ¡(e.g. ¡life) ¡ § Gives ¡nonsta)onary ¡policies ¡( π ¡depends ¡on ¡)me ¡lev) ¡ § Quiz ¡1: ¡For ¡ γ ¡= ¡1, ¡what ¡is ¡the ¡op)mal ¡policy? ¡ § Discoun)ng: ¡use ¡0 ¡< ¡ γ ¡< ¡1 ¡ § Quiz ¡2: ¡For ¡ γ ¡= ¡0.1, ¡what ¡is ¡the ¡op)mal ¡policy? ¡ § Smaller ¡ γ ¡means ¡smaller ¡“horizon” ¡– ¡shorter ¡term ¡focus ¡ § Quiz ¡3: ¡For ¡which ¡ γ are ¡West ¡and ¡East ¡equally ¡good ¡when ¡in ¡state ¡d? ¡ § Absorbing ¡state: ¡guarantee ¡that ¡for ¡every ¡policy, ¡a ¡terminal ¡state ¡will ¡eventually ¡ be ¡reached ¡(like ¡“overheated” ¡for ¡racing) ¡ 5

  6. Recap: ¡Defining ¡MDPs ¡ Solving ¡MDPs ¡ § Markov ¡decision ¡processes: ¡ s § Set ¡of ¡states ¡S ¡ a § Start ¡state ¡s 0 ¡ § Set ¡of ¡ac)ons ¡A ¡ s, ¡a ¡ § Transi)ons ¡P(s’|s,a) ¡(or ¡T(s,a,s’)) ¡ s,a,s ’ ¡ § Rewards ¡R(s,a,s’) ¡(and ¡discount ¡ γ ) ¡ s ’ ¡ § MDP ¡quan))es ¡so ¡far: ¡ § Policy ¡= ¡Choice ¡of ¡ac)on ¡for ¡each ¡state ¡ § U)lity ¡= ¡sum ¡of ¡(discounted) ¡rewards ¡ Op)mal ¡Quan))es ¡ Snapshot ¡of ¡Demo ¡– ¡Gridworld ¡V ¡Values ¡ § The ¡value ¡(u)lity) ¡of ¡a ¡state ¡s: ¡ V * (s) ¡= ¡expected ¡u)lity ¡star)ng ¡in ¡s ¡and ¡ s ¡is ¡a ¡ s ¡ state ¡ ac)ng ¡op)mally ¡ a ¡ (s, ¡a) ¡is ¡a ¡ § The ¡value ¡(u)lity) ¡of ¡a ¡q-­‑state ¡(s,a): ¡ s, ¡a ¡ q-­‑state ¡ Q * (s,a) ¡= ¡expected ¡u)lity ¡star)ng ¡out ¡ s,a,s’ ¡ (s,a,s’) ¡is ¡a ¡ ¡ having ¡taken ¡ac)on ¡a ¡from ¡state ¡s ¡and ¡ transi-on ¡ (thereaver) ¡ac)ng ¡op)mally ¡ s’ ¡ ¡ § The ¡op)mal ¡policy: ¡ π * (s) ¡= ¡op)mal ¡ac)on ¡from ¡state ¡s ¡ Noise ¡= ¡0.2 ¡ Discount ¡= ¡0.9 ¡ Living ¡reward ¡= ¡0 ¡ [Demo ¡– ¡gridworld ¡values ¡(L8D4)] ¡ 6

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