Artificial Intelligence Game Playing Continued Lecture 9 CS 444 - - PowerPoint PPT Presentation

artificial intelligence
SMART_READER_LITE
LIVE PREVIEW

Artificial Intelligence Game Playing Continued Lecture 9 CS 444 - - PowerPoint PPT Presentation

Artificial Intelligence Game Playing Continued Lecture 9 CS 444 Spring 2019 Dr. Kevin Molloy Department of Computer Science James Madison University Outline Moving forward with game playing How to play games of chance Example


slide-1
SLIDE 1

Artificial Intelligence

CS 444 – Spring 2019

  • Dr. Kevin Molloy

Department of Computer Science James Madison University

Game Playing Continued

Lecture 9

slide-2
SLIDE 2

Outline

  • Moving forward with game playing
  • How to play games of chance
  • Example Problem
  • Project 2
slide-3
SLIDE 3

Review of !- " Pruning

Pruning is an example of metareasoning – computing about what to compute This type of pruning does not impact optimality of the decision (but does mean some of the nodes may not have the correct values). Even with perfect ordering, time complexity = O(bm/2) (m is max depth) Chess is still impossible (3550 possibilities) Idea: obtain value of a state (move) without reaching the leaf states

slide-4
SLIDE 4

Resource Limits

Standard approach:

  • Use Cutoff-Test instead of Terminal-Test (e.g., depth limited search)
  • Use Eval instead of Utility (heuristic evaluation)

Chess Example: Suppose we have 100 seconds, explore 104nodes/seconds 106 nodes per move ≈ 35 8/2 !-" reaches depth 8 ⟹ pretty good chess program

slide-5
SLIDE 5

Evaluation Functions

For chess, typically linear weighted sum

  • f features:

Eval(s) = w1f1(s) + w2f2(s) + … + wnfn(s) e.g. w1 = 9 with f1(s) (difference in the #

  • f queens)

Behavior is preserved under any monotonic transformation of eval. Only order matters.

slide-6
SLIDE 6

Deterministic games in practice

Chess: Deep blue defeated Gary Kasparov in a six-game match in 1997. The computer searched 200 million positions per second, and was able to extend some search lines up to 40 ply. Go: branching factor is between 250 and 361 (compared to chess at 35). Pattern knowledge is used instead of search trees. AlphaGo, which employs deep learning, is now competing at the world championship

  • level. (https://deepmind.com/research/alphago/).
slide-7
SLIDE 7

Nondeterministic Games:

slide-8
SLIDE 8

Nondeterministic Games

In nondeterministic games, chance is introduced by dice, card-shuffling, etc. Here is a simplified example with coin-flipping:

New type of node in our tree We will call this a chance node.

slide-9
SLIDE 9

Minimax ⟹ ExpectiMiniMax for Nondeterministic Games

If state is a Max node then return highest ExpectiMiniMax-Value of Successor(state) Just like MiniMax, except we must also handle chance nodes: If state is a Min node then return lowest ExpectiMiniMax-Value of Successor(state) If state is a chance node then return average ExpectiMiniMax-Value of Successor(state)

slide-10
SLIDE 10

Nondeterministic Games in Practice

Backgammon ≈ 20 legal moves (can be 6,000 in 1-1- roll) Depth 4 = 20 x (21 x 20)3 ≈ 1.2 x 109 Dice rolls increase b: 21 possible distinct rolls with 2 dice. Time complexity: O(bm nm), where n is the number of distinct roll Does it pay to look ahead? As depth increases, probability of reaching a given node shrinks, thus, its value is diminished. Thus, !-" pruning is not as effective. TDGammon uses depth-2 search and good EVAL and plays at the World champion level

slide-11
SLIDE 11

Careful EVAL: Exact Values DO matter

  • Notice the difference between these two trees.
slide-12
SLIDE 12

Monte Carlo Simulation

Monte Carlo simulation can be used to “evaluate” a state From a start date, have the algorithm play against itself, using random dice rolls Imperfect Information: From a start date, have the algorithm play against itself, using random dice rolls. Ideas for poker? Generate random hands for your opponent and count how many times you win.

slide-13
SLIDE 13

ExpectiMinMax Problem to Solve

Ghost makes the best move 2/3 of the time, but 1/3 of the time makes the worst move. Fill in the blank nodes