projects
play

Projects Recita)ons: Thursday 4:30pm 5:30pm, Annenberg 107 - PowerPoint PPT Presentation

Introduc)on to Ar)ficial Intelligence Lecture 4 Adversarial search CS/CNS/EE 154 Andreas Krause TexPoint fonts used in EMF. Projects Recita)ons:


  1. Introduc)on ¡to ¡ ¡ Ar)ficial ¡Intelligence ¡ Lecture ¡4 ¡– ¡Adversarial ¡search ¡ CS/CNS/EE ¡154 ¡ Andreas ¡Krause ¡ TexPoint ¡fonts ¡used ¡in ¡EMF. ¡ ¡

  2. Projects ¡ � Recita)ons: ¡Thursday ¡4:30pm ¡– ¡5:30pm, ¡Annenberg ¡107 ¡ � Details ¡about ¡projects ¡ � Will ¡also ¡be ¡posted ¡on ¡webpage ¡ � By ¡Monday ¡10/11 ¡ � Form ¡team ¡of ¡3 ¡students ¡ � Need ¡to ¡select ¡project ¡(Doodle ¡link ¡will ¡be ¡sent ¡today) ¡ � For ¡independent ¡projects: ¡need ¡to ¡submit ¡proposal ¡ � If ¡you ¡don’t ¡have ¡a ¡team, ¡send ¡email ¡to ¡TAs ¡ � Homework ¡1 ¡out ¡on ¡Friday ¡ 2 ¡

  3. Types ¡of ¡games ¡ Chess ¡ Backgammon ¡ Poker ¡ Rock ¡Paper ¡ WoW ¡ Scissors ¡ Observable? ¡ Determ.? ¡ Simultan.? ¡ Zero-­‑sum? ¡ Discrete? ¡ # ¡Players? ¡ In ¡this ¡class, ¡focus ¡on ¡two-­‑player, ¡sequen)al, ¡zero-­‑sum, ¡ ¡ discrete ¡(mostly ¡determinis)c) ¡ 3 ¡

  4. Games ¡vs. ¡search ¡ � In ¡games, ¡ac)ons ¡are ¡nondeterminis)c ¡ � Opponent ¡can ¡affect ¡state ¡of ¡the ¡environment ¡ � Op)mal ¡solu)on ¡no ¡longer ¡sequence ¡of ¡ac)ons, ¡ instead ¡a ¡strategy ¡(policy, ¡condi)onal ¡plan) ¡ � If ¡you ¡X ¡I’ll ¡do ¡Y, ¡else ¡if ¡you ¡do ¡Y ¡I’ll ¡do ¡Z, ¡…. ¡ 4 ¡

  5. Game ¡tree ¡ 5 ¡

  6. Minimax ¡game ¡tree ¡ � Search ¡for ¡op)mal ¡move ¡no ¡mafer ¡what ¡opponent ¡does ¡ � minimax ¡value ¡= ¡best ¡achievable ¡payoff ¡against ¡best ¡play ¡ 6 ¡

  7. Solving ¡determinis)c ¡games ¡ � MiniMax ¡used ¡to ¡calculate ¡op)mal ¡move: ¡ � Induc)ve ¡defini)on: ¡ ¡ If n is terminal node: � Value is utility( n.state ) If n is MAX node: � Value is highest value of all successor node values If n is MIN node � Value is lowest value of all successor node values 7 ¡

  8. Proper)es ¡of ¡minimax ¡search ¡ � Complete? ¡ � Time ¡complexity? ¡ � Space ¡complexity? ¡ � Op)mal? ¡ 8 ¡

  9. α-­‑β-­‑pruning ¡ 9 ¡

  10. α-­‑β-­‑pruning ¡ 10 ¡

  11. α-­‑β-­‑pruning ¡ 11 ¡

  12. α-­‑β-­‑pruning ¡ 12 ¡

  13. α-­‑β-­‑pruning ¡ 13 ¡

  14. α-­‑β-­‑pruning ¡ 14 ¡

  15. α-­‑β-­‑pruning ¡ � Key ¡idea: ¡For ¡each ¡node ¡n ¡in ¡minimax ¡tree ¡keep ¡track ¡of ¡ � α: ¡Best ¡value ¡for ¡MAX ¡player ¡if ¡n ¡is ¡reached ¡ � β: ¡Best ¡value ¡for ¡MIN ¡player ¡if ¡n ¡is ¡reached ¡ � Never ¡need ¡to ¡explore ¡ ¡ consequences ¡of ¡ac)ons ¡ ¡ for ¡which ¡β<α ¡ � Avoid ¡exploring ¡“provably ¡ subop)mal” ¡parts ¡ ¡ of ¡minimax ¡tree ¡ 15 ¡

  16. α-­‑β-­‑pruning ¡algorithm ¡ 16 ¡

  17. Does ¡move ¡ordering ¡mafer? ¡ 17 ¡

  18. Move ¡ordering ¡mafers ¡a ¡lot ¡ � Worst ¡case: ¡No ¡improvement ¡ � Best ¡case ¡(ideal ¡ordering): ¡ � Random ¡ordering: ¡ � How ¡to ¡find ¡a ¡good ¡ordering? ¡ 18 ¡

  19. Large ¡state ¡spaces ¡ � Typical ¡branching ¡factor ¡in ¡chess: ¡35 ¡ � Compu)ng ¡the ¡complete ¡minimax ¡tree ¡is ¡intractable ¡ � Instead: ¡Cut ¡off ¡search, ¡and ¡replace ¡u)lity(s) ¡with ¡eval(s) ¡ � eval(s) ¡is ¡heuris)c ¡value ¡of ¡state ¡s ¡ 19 ¡

  20. Developing ¡evalua)on ¡func)ons ¡ � This ¡is ¡where ¡expert ¡knowledge ¡comes ¡in ¡ � Typical ¡approach: ¡ � Select ¡features ¡f 1 ,…,f n ¡that ¡may ¡be ¡useful, ¡e.g., ¡value ¡of ¡ pieces ¡on ¡board, ¡posi)ons ¡of ¡pieces, ¡… ¡ � Learn ¡weights ¡from ¡examples ¡ � Deep ¡Blue ¡used ¡~6,000 ¡different ¡features! ¡ � Osen, ¡reinforcement ¡learning ¡is ¡very ¡useful ¡here ¡ ¡ (e.g., ¡TD-­‑gammon ¡beats ¡world ¡champion ¡in ¡backgammon) ¡ 20 ¡

  21. Problems ¡with ¡cutoff ¡search ¡ Black ¡to ¡move ¡ 21 ¡

  22. Taming ¡the ¡horizon ¡effect ¡ � Quiescence ¡search ¡ � Evalua)on ¡func)on ¡also ¡evaluates ¡“stability” ¡(e.g., ¡strong ¡ captures, ¡etc.) ¡ � Cutoff ¡postponed ¡if ¡posi)on ¡is ¡unstable ¡ � Search ¡)me ¡no ¡longer ¡constant ¡ � Singular ¡extension ¡ � Search ¡deeper ¡if ¡a ¡node’s ¡value ¡is ¡much ¡befer ¡than ¡its ¡ siblings’ ¡ � Reduces ¡effec)ve ¡branching ¡factor ¡ � Can ¡search ¡much ¡longer ¡sequences ¡(even ¡30-­‑40ply) ¡ ¡ 22 ¡

  23. Playing ¡world ¡class ¡chess ¡ � Current ¡PCs ¡can ¡evaluate ¡~200 ¡million ¡nodes ¡/ ¡3 ¡min ¡ � Minimax ¡search: ¡~5 ¡ply ¡lookahead ¡ � With ¡α-­‑β ¡pruning: ¡~10 ¡ply ¡ � Further ¡improvements: ¡ � Quiescence ¡search : ¡Only ¡evaluate ¡“stable” ¡posi)ons ¡ � Transposi/on ¡tables : ¡Remember ¡states ¡evaluated ¡before ¡ � Singular ¡extensions : ¡Expand ¡tree ¡if ¡there ¡is ¡singular ¡best ¡move ¡ � Null ¡move ¡heuris/c : ¡Get ¡lower ¡bound ¡by ¡leung ¡opp. ¡move ¡2x ¡ � Precompute ¡endgames ¡ (all ¡5, ¡some ¡6 ¡piece ¡posi)ons) ¡ � Opening ¡library ¡ (up ¡to ¡~30ply ¡in ¡first ¡couple ¡moves) ¡ � Hydra: ¡18 ¡ply ¡lookahead ¡(on ¡64 ¡processor ¡cluster) ¡ 23 ¡

  24. Stochas)c ¡games ¡ � Two ¡“types” ¡of ¡uncertainty ¡ � Adversarial ¡and ¡stochas)c ¡ 24 ¡

  25. Expec)MiniMax ¡tree ¡ 25 ¡

  26. Solving ¡stochas)c ¡games ¡ � Expec)MiniMax ¡used ¡to ¡calculate ¡op)mal ¡move ¡ � Defined ¡induc)vely: ¡ ¡ If n is terminal node (or cutoff): � Value is utility( n.state ) (or eval( n.state )) If n is MAX node: � Value is highest value of all successor node values If n is MIN node � Value is lowest value of all successor node values If n is CHANCE node � Value is (weighted) average of all successor node values 26 ¡

  27. Dealing ¡with ¡large ¡state ¡spaces ¡ � Backgammon: ¡ ¡ � 21 ¡possible ¡roles ¡with ¡2 ¡die; ¡~20 ¡legal ¡moves ¡ ¡ � #nodes ¡for ¡depth ¡4 ¡tree: ¡ � As ¡depth ¡increases, ¡reaching ¡any ¡par)cular ¡node ¡ becomes ¡exponen)ally ¡unlikely ¡ � Lookahead ¡becomes ¡less ¡valuable ¡ � α-­‑β-­‑pruning ¡much ¡less ¡useful: ¡world ¡just ¡won’t ¡play ¡along! ¡ � TD-­‑gammon ¡compe))ve ¡with ¡best ¡human ¡players: ¡ � Uses ¡only ¡2 ¡ply ¡lookahead! ¡ � But ¡very ¡carefully ¡trained ¡evalua)on ¡func)on ¡ 27 ¡

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