Recita)ons and office hours Office hours TAs: Tuesday - - PowerPoint PPT Presentation

recita ons and office hours
SMART_READER_LITE
LIVE PREVIEW

Recita)ons and office hours Office hours TAs: Tuesday - - PowerPoint PPT Presentation

Introduc)on to Ar)ficial Intelligence Lecture 3 Informed Search CS/CNS/EE 154 Andreas Krause TexPoint fonts used in EMF. Recita)ons and office


slide-1
SLIDE 1

Introduc)on ¡to ¡ ¡

Ar)ficial ¡Intelligence ¡

Lecture ¡3 ¡– ¡Informed ¡Search ¡

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

slide-2
SLIDE 2

Recita)ons ¡and ¡office ¡hours ¡

Office ¡hours ¡TAs: ¡Tuesday ¡4:30-­‑5:30 ¡in ¡Annenberg ¡213 ¡ Office ¡hours ¡Instructor: ¡ ¡Wednesday ¡4-­‑5 ¡in ¡Annenberg ¡300 ¡ Recita)ons: ¡Thursday ¡4:30-­‑5:30 ¡in ¡Annenberg ¡107 ¡

Op)onal ¡but ¡encouraged ¡ Will ¡review ¡material ¡from ¡class ¡ Discuss ¡projects ¡in ¡more ¡detail ¡

2 ¡

slide-3
SLIDE 3

Challenge ¡projects ¡

Two ¡projects ¡

“Crowdsourcing ¡science” ¡ “AI ¡in ¡games” ¡

Details ¡given ¡in ¡recita)on ¡on ¡Thursday, ¡and ¡posted ¡on ¡

the ¡website ¡

Implementa)on ¡in ¡Python ¡ Milestone ¡a[er ¡~4 ¡weeks ¡

Simpler ¡version ¡of ¡the ¡challenge ¡ Feedback ¡on ¡implementa)on ¡

Final ¡challenge ¡

Compare ¡algorithms ¡in ¡a ¡compe))on ¡

3 ¡

slide-4
SLIDE 4

Intelligent ¡field ¡guide ¡

“Crowdsourcing ¡science” ¡

Recruit ¡popula)on ¡to ¡help ¡map ¡out ¡rare ¡bird ¡species ¡ Exis)ng ¡field ¡guides ¡cumbersome ¡to ¡use ¡ Create ¡“intelligent ¡field ¡guide” ¡that ¡lets ¡ ¡

people ¡iden)fy ¡bird ¡species ¡by ¡“asking ¡the ¡right ¡ques)ons” ¡

4 ¡

Welinder ¡ et ¡al ¡‘10 ¡

slide-5
SLIDE 5

Intelligent ¡field ¡guide ¡

Project ¡goal ¡

Use ¡AI ¡techniques ¡to ¡adap)vely ¡ask ¡ques)ons ¡to ¡iden)fy ¡

bird ¡species ¡

Data ¡/ ¡Input ¡

Data ¡set ¡containing ¡answers ¡to ¡ques)ons ¡about ¡200 ¡birds ¡

Performance ¡measure: ¡accuracy; ¡# ¡ques)ons ¡used ¡

Milestone: ¡Only ¡correct ¡answers ¡ Final ¡challenge: ¡“Noisy” ¡answers; ¡hold ¡out ¡test ¡set; ¡allowed ¡

to ¡use ¡images.. ¡

5 ¡

slide-6
SLIDE 6

PAC-­‑MAN ¡vs. ¡PAC-­‑MAN ¡

Game ¡descrip)on ¡

“Symmetric” ¡version ¡of ¡PAC-­‑MAN ¡ Who ¡eats ¡most ¡“pac ¡dots” ¡wins ¡ Ea)ng ¡a ¡“power ¡pellet” ¡turns ¡PAC-­‑MAN ¡into ¡a ¡ghost ¡

Project ¡goal ¡

Develop ¡AI ¡to ¡win ¡the ¡ea)ng ¡compe))on ¡

Data ¡/ ¡Input ¡

Descrip)on ¡of ¡maze ¡(graph) ¡ Loca)on ¡of ¡“pac ¡dots” ¡and ¡“power ¡pellets” ¡

Performance ¡measure: ¡# ¡pac ¡dots ¡eaten ¡

Milestone: ¡ ¡No ¡power ¡pellets; ¡known ¡maze ¡ Final ¡challenge: ¡power ¡pellets; ¡mo)on ¡noise; ¡new ¡maze ¡

6 ¡

slide-7
SLIDE 7

Independent ¡projects ¡

For ¡students ¡who ¡do ¡AI-­‑related ¡research ¡ Need ¡to ¡come ¡up ¡with ¡your ¡own ¡project ¡ Must ¡be ¡“something ¡new” ¡for ¡this ¡class ¡ Groups ¡of ¡2-­‑3 ¡students ¡ Will ¡be ¡advised ¡by ¡TAs ¡and ¡instructor ¡ Need ¡to ¡submit ¡

Project ¡proposal ¡ Milestone ¡report ¡ Final ¡report ¡

Most ¡students ¡expected ¡to ¡choose ¡one ¡of ¡the ¡two ¡

challenge ¡projects ¡

7 ¡

slide-8
SLIDE 8

Project ¡)meline ¡

By ¡next ¡Monday ¡(Oct ¡11) ¡

Form ¡teams ¡of ¡3 ¡students ¡ Indicate ¡preference ¡for ¡projects ¡

Milestone ¡implementa)on ¡due: ¡November ¡3 ¡ Final ¡implementa)on ¡due: ¡December ¡1 ¡

8 ¡

slide-9
SLIDE 9

Search ¡

“Get ¡from ¡state ¡A ¡to ¡B ¡as ¡quickly ¡as ¡possible” ¡ A ¡fundamental ¡problem ¡in ¡many ¡AI ¡problems ¡

Naviga)on, ¡VLSI ¡layout, ¡resource ¡alloca)on, ¡planning, ¡… ¡

For ¡now ¡assume ¡

Fully ¡observable ¡environment ¡and ¡determinis)c ¡ac)ons ¡

9 ¡

slide-10
SLIDE 10

Search ¡with ¡goal ¡based ¡agents ¡

Agent ¡has ¡ ¡

model ¡of ¡environment ¡(map, ¡puzzle ¡rules, ¡mechanics,…) ¡

How ¡will ¡the ¡environment ¡change ¡if ¡I ¡do ¡X? ¡

Goal ¡checker: ¡

Declares ¡some ¡environment ¡states ¡as ¡goals ¡

Performance ¡measure: ¡

Sum ¡of ¡ac)on ¡costs ¡ If ¡all ¡ac)ons ¡cost ¡the ¡same ¡this ¡is ¡called ¡unit ¡cost ¡model ¡

Agent ¡func)on: ¡

Find ¡cheapest ¡sequence ¡of ¡ac)ons ¡to ¡get ¡to ¡a ¡goal ¡state ¡

10 ¡

slide-11
SLIDE 11

State ¡spaces ¡

Vacuum ¡robot: ¡ ¡8 ¡states ¡ Rubik’s ¡cube: ¡

¡10^19 ¡states… ¡

Climbing ¡stairs: ¡ ¡∞ ¡states! ¡ Cannot ¡represent ¡search ¡graph ¡explicitly! ¡ Implicit ¡representa)on: ¡

Successor ¡func)ons ¡maps ¡states ¡to ¡set ¡of ¡(ac)on,state) ¡pairs ¡ Specifies ¡which ¡states ¡can ¡be ¡reached ¡immediately ¡from ¡any ¡

given ¡state ¡

11 ¡

slide-12
SLIDE 12

Review: ¡Tree ¡search ¡

12 ¡

slide-13
SLIDE 13

Comparison ¡of ¡algorithms ¡

13 ¡

Strategy ¡

BFS ¡ Uniform ¡ cost ¡ DFS ¡ Itera5ve ¡ deepening ¡

  • Bidirect. ¡

Complete ¡ Yes* ¡ Yes* ¡ No ¡ Yes ¡ Yes ¡ Time ¡ bd+1 ¡ bC/ε ¡ bm ¡ bd ¡ bd/2 ¡ Space ¡ bd+1 ¡ bC/ε ¡ b ¡m ¡ b ¡d ¡ bd/2 ¡ Op5mal ¡ Yes* ¡ Yes ¡ No ¡ Yes* ¡ Yes* ¡

slide-14
SLIDE 14

Informed ¡vs. ¡uninformed ¡search ¡

Uninformed ¡search ¡

Can ¡only ¡dis)nguish ¡goals ¡from ¡non-­‑goal ¡states ¡

Informed ¡search ¡

Have ¡informa)on ¡about ¡progress ¡towards ¡the ¡op)mal ¡solu)on ¡ This ¡lecture! ¡

14 ¡

slide-15
SLIDE 15

Informed ¡search ¡

Key ¡idea: ¡ ¡

Use ¡informa)on ¡about ¡how ¡undesirable ¡each ¡node ¡is ¡

Expand ¡nodes ¡in ¡order ¡of ¡“undesirability” ¡ Implemented ¡by ¡using ¡a ¡priority ¡queue ¡for ¡fringe ¡ Generalizes ¡uninformed ¡search ¡

BFS: ¡Undesirability ¡= ¡depth ¡of ¡node ¡ DFS: ¡Undesirability ¡= ¡-­‑ ¡depth ¡of ¡node ¡

If ¡“undesirability” ¡chosen ¡carefully, ¡can ¡get ¡dras)cally ¡

improved ¡performance ¡ ¡

15 ¡

slide-16
SLIDE 16

Example: ¡Romania ¡

16 ¡

Straight-­‑line ¡distance ¡ ¡ to ¡Bucharest ¡

Undesirability? ¡

slide-17
SLIDE 17

Greedy ¡search ¡

Use ¡es)mate ¡h(n) ¡of ¡distance ¡to ¡closest ¡goal ¡(heuris)c) ¡ Greedy ¡search ¡sets ¡undesirability ¡of ¡node ¡as ¡h(n) ¡

17 ¡

slide-18
SLIDE 18

Greedy ¡search ¡

18 ¡

slide-19
SLIDE 19

Greedy ¡search ¡

19 ¡

slide-20
SLIDE 20

Greedy ¡search ¡

20 ¡

slide-21
SLIDE 21

Greedy ¡search ¡

21 ¡

slide-22
SLIDE 22

Proper)es ¡of ¡Greedy ¡search ¡

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

22 ¡

slide-23
SLIDE 23

Example: ¡Greedy ¡is ¡not ¡complete ¡

23 ¡

slide-24
SLIDE 24

Example: ¡Greedy ¡search ¡is ¡not ¡op)mal ¡

24 ¡

slide-25
SLIDE 25

A*-­‑search ¡

One ¡of ¡the ¡most ¡useful ¡search ¡algorithms! ¡ Key ¡idea: ¡Prune ¡away ¡expensive ¡paths! ¡ Desirability ¡of ¡node ¡n: ¡f(n) ¡= ¡h(n) ¡+ ¡g(n) ¡

g(n) ¡= ¡cost ¡of ¡node ¡n ¡ h(n) ¡= ¡es)mated ¡cost ¡to ¡goal ¡ f(n) ¡= ¡es)mated ¡total ¡cost ¡of ¡cheapest ¡path ¡through ¡n ¡to ¡goal ¡

25 ¡

slide-26
SLIDE 26

A*-­‑search ¡

26 ¡

slide-27
SLIDE 27

A*-­‑search ¡

27 ¡

slide-28
SLIDE 28

A*-­‑search ¡

28 ¡

slide-29
SLIDE 29

A*-­‑search ¡

29 ¡

slide-30
SLIDE 30

A*-­‑search ¡

30 ¡

slide-31
SLIDE 31

A*-­‑search ¡

31 ¡

slide-32
SLIDE 32

Op)mality ¡of ¡A* ¡

Bad ¡choice ¡of ¡heuris)c ¡can ¡break ¡A* ¡

Can ¡“block” ¡(discourage ¡expansion ¡of) ¡nodes ¡that ¡lead ¡to ¡

the ¡op)mal ¡solu)on ¡using ¡large ¡h(n) ¡

A ¡heuris)c ¡func)on ¡h(n) ¡is ¡called ¡admissible ¡if ¡it ¡never ¡

  • veres)mates ¡the ¡true ¡cost: ¡

¡Theorem: ¡For ¡admissible ¡heuris)cs, ¡A* ¡is ¡op)mal ¡

32 ¡

slide-33
SLIDE 33

Proof: ¡Op)mality ¡of ¡A* ¡

33 ¡

slide-34
SLIDE 34

Monotonic ¡(consistent) ¡heuris)cs ¡

A ¡heuris)c ¡h(n) ¡is ¡called ¡monotonic ¡(consistent), ¡if ¡for ¡

all ¡nodes ¡n, ¡n’ ¡and ¡ac)ons ¡a ¡it ¡holds ¡

Monotonicity ¡implies ¡admissibility ¡ Example: ¡Straight ¡line ¡distance ¡is ¡monotonic ¡

34 ¡

slide-35
SLIDE 35

A* ¡for ¡monotonic ¡heuris)cs ¡

A* ¡expands ¡nodes ¡along ¡monotonically ¡increasing ¡f-­‑values ¡ With ¡monotonicity, ¡even ¡A*-­‑graph ¡search ¡is ¡op)mal! ¡

35 ¡

slide-36
SLIDE 36

Note ¡on ¡completeness ¡of ¡A* ¡

Technically, ¡completeness ¡of ¡A* ¡requires ¡lower ¡bound ¡

  • n ¡ac)on ¡cost ¡

Otherwise, ¡there ¡could ¡be ¡∞-­‑many ¡nodes ¡with ¡

36 ¡

slide-37
SLIDE 37

Complexity ¡of ¡A* ¡

Generally ¡

Heuris)c ¡h(n) ¡= ¡0 ¡is ¡admissible.. ¡

Can ¡be ¡subexponen)al ¡if ¡heuris)c ¡is ¡accurate: ¡ Unfortunately, ¡in ¡prac)ce ¡this ¡can ¡be ¡rarely ¡guaranteed.. ¡ But ¡A* ¡o[en ¡s)ll ¡works ¡extremely ¡well! ¡ ¡

37 ¡

slide-38
SLIDE 38

Proper)es ¡of ¡A* ¡search ¡

Completeness: ¡ Time ¡complexity: ¡ ¡ Space ¡complexity: ¡ Op)mality: ¡

38 ¡

slide-39
SLIDE 39

Reducing ¡memory ¡usage ¡

For ¡monotonic ¡heuris)cs, ¡can ¡use ¡variant ¡of ¡IDS: ¡IDA* ¡ Itera)vely ¡increase ¡maximum ¡f ¡value ¡ Use ¡“f-­‑value ¡bounded ¡DFS” ¡ Trades ¡polynomial ¡increase ¡in ¡running ¡)me ¡with ¡up ¡to ¡

exponen)al ¡reduc)on ¡in ¡space ¡

However, ¡in ¡prac)ce ¡

not ¡as ¡useful ¡as ¡IDS ¡ for ¡good ¡heuris)cs ¡

39 ¡

slide-40
SLIDE 40

Example: ¡admissible ¡heuris)cs ¡

40 ¡

slide-41
SLIDE 41

Dominance ¡

Suppose ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡are ¡admissible ¡and ¡ Then ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡dominates ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡is ¡beyer ¡for ¡search ¡

(expands ¡fewer ¡nodes) ¡

Given ¡any ¡two ¡admissible ¡heuris)cs ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡ ¡ ¡ ¡ ¡ ¡ ¡, ¡

¡is ¡admissible ¡and ¡dominates ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡ ¡

41 ¡

slide-42
SLIDE 42

Example: ¡Benefit ¡of ¡A* ¡search ¡

¡ ¡ ¡ ¡ ¡: ¡ ¡number ¡of ¡ ¡

¡misplaced ¡)les ¡

¡ ¡ ¡ ¡ ¡: ¡total ¡Manhayan ¡

¡distance ¡

8-­‑puzzle: ¡

IDS:

¡6,384 ¡nodes ¡

A*(h1): ¡39 ¡nodes ¡ A*(h2): ¡25 ¡nodes ¡

24-­‑puzzle: ¡

IDS:

¡~54,000,000,000 ¡nodes ¡

A*(h1): ¡39,135 ¡nodes ¡ A*(h2): ¡1,641 ¡nodes ¡

42 ¡

slide-43
SLIDE 43

Developing ¡admissible ¡heuris)cs ¡

Admissibility ¡requires ¡that ¡ ¡ Ideally: ¡Want ¡to ¡use ¡ ¡ But ¡compu)ng ¡ ¡

¡ ¡ ¡is ¡as ¡hard ¡as ¡the ¡search ¡problem ¡

Key ¡idea: ¡Get ¡lower ¡bound ¡by ¡relaxing ¡some ¡constraints ¡ E.g., ¡in ¡8 ¡puzzle: ¡Relax ¡constraint ¡that ¡)les ¡can’t ¡be ¡on ¡

top ¡of ¡each ¡other ¡

43 ¡

slide-44
SLIDE 44

Example: ¡TSP ¡

Traveling ¡salesman ¡problem: ¡Find ¡shortest ¡tour ¡

through ¡graph ¡visi)ng ¡all ¡nodes ¡

NP ¡complete ¡

44 ¡

slide-45
SLIDE 45

What ¡you ¡need ¡to ¡know ¡

Informed ¡search ¡uses ¡heuris)cs ¡to ¡choose ¡nodes ¡for ¡

expansion ¡

Greedy ¡search ¡is ¡subop)mal ¡and ¡incomplete ¡ A* ¡search ¡is ¡op)mal ¡for ¡admissible ¡heuris)cs ¡ IDA* ¡trades ¡)me ¡for ¡space ¡complexity ¡ Can ¡obtain ¡admissible ¡heuris)cs ¡by ¡relaxing ¡the ¡

search ¡problem ¡

45 ¡