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

projects
SMART_READER_LITE
LIVE PREVIEW

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:


slide-1
SLIDE 1

Introduc)on ¡to ¡ ¡

Ar)ficial ¡Intelligence ¡

Lecture ¡4 ¡– ¡Adversarial ¡search ¡

CS/CNS/EE ¡154 ¡ Andreas ¡Krause ¡ TexPoint ¡fonts ¡used ¡in ¡EMF. ¡ ¡

slide-2
SLIDE 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 ¡

slide-3
SLIDE 3

Types ¡of ¡games ¡

Chess ¡ Backgammon ¡ Poker ¡ Rock ¡Paper ¡ Scissors ¡ WoW ¡ Observable? ¡ Determ.? ¡ Simultan.? ¡ Zero-­‑sum? ¡ Discrete? ¡ # ¡Players? ¡

3 ¡

In ¡this ¡class, ¡focus ¡on ¡two-­‑player, ¡sequen)al, ¡zero-­‑sum, ¡ ¡ discrete ¡(mostly ¡determinis)c) ¡

slide-4
SLIDE 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 ¡

slide-5
SLIDE 5

Game ¡tree ¡

5 ¡

slide-6
SLIDE 6

Minimax ¡game ¡tree ¡

Search ¡for ¡op)mal ¡move ¡no ¡mafer ¡what ¡opponent ¡does ¡ minimax ¡value ¡= ¡best ¡achievable ¡payoff ¡against ¡best ¡play ¡

6 ¡

slide-7
SLIDE 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 ¡

slide-8
SLIDE 8

Proper)es ¡of ¡minimax ¡search ¡

Complete? ¡ Time ¡complexity? ¡ Space ¡complexity? ¡ Op)mal? ¡

8 ¡

slide-9
SLIDE 9

α-­‑β-­‑pruning ¡

9 ¡

slide-10
SLIDE 10

α-­‑β-­‑pruning ¡

10 ¡

slide-11
SLIDE 11

α-­‑β-­‑pruning ¡

11 ¡

slide-12
SLIDE 12

α-­‑β-­‑pruning ¡

12 ¡

slide-13
SLIDE 13

α-­‑β-­‑pruning ¡

13 ¡

slide-14
SLIDE 14

α-­‑β-­‑pruning ¡

14 ¡

slide-15
SLIDE 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 ¡ ¡

  • f ¡minimax ¡tree ¡

15 ¡

slide-16
SLIDE 16

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

16 ¡

slide-17
SLIDE 17

Does ¡move ¡ordering ¡mafer? ¡

17 ¡

slide-18
SLIDE 18

Move ¡ordering ¡mafers ¡a ¡lot ¡

Worst ¡case: ¡No ¡improvement ¡ Best ¡case ¡(ideal ¡ordering): ¡ Random ¡ordering: ¡ How ¡to ¡find ¡a ¡good ¡ordering? ¡

18 ¡

slide-19
SLIDE 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 ¡

slide-20
SLIDE 20

Developing ¡evalua)on ¡func)ons ¡

This ¡is ¡where ¡expert ¡knowledge ¡comes ¡in ¡ Typical ¡approach: ¡

Select ¡features ¡f1,…,fn ¡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 ¡

slide-21
SLIDE 21

Problems ¡with ¡cutoff ¡search ¡

21 ¡

Black ¡to ¡move ¡

slide-22
SLIDE 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 ¡

slide-23
SLIDE 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 ¡

slide-24
SLIDE 24

Stochas)c ¡games ¡

Two ¡“types” ¡of ¡uncertainty ¡ Adversarial ¡and ¡stochas)c ¡

24 ¡

slide-25
SLIDE 25

Expec)MiniMax ¡tree ¡

25 ¡

slide-26
SLIDE 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 ¡

slide-27
SLIDE 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 ¡