Today’s Topics Playing Deterministic (no Dice, etc) Games –Mini-max –  -  pruning –ML and games? 1997: Computer Chess Player (IBM’s Deep Blue) Beat Human.

Slides:



Advertisements
Similar presentations
Adversarial Search Chapter 6 Section 1 – 4. Types of Games.
Advertisements

Adversarial Search We have experience in search where we assume that we are the only intelligent being and we have explicit control over the “world”. Lets.
Adversarial Search Reference: “Artificial Intelligence: A Modern Approach, 3 rd ed” (Russell and Norvig)
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
AI for Connect-4 (or other 2-player games) Minds and Machines.
Games & Adversarial Search
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
CS 484 – Artificial Intelligence
Adversarial Search Chapter 6 Section 1 – 4.
Adversarial Search Chapter 5.
Adversarial Search: Game Playing Reading: Chapter next time.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Adversarial Search CSE 473 University of Washington.
Adversarial Search 對抗搜尋. Outline  Optimal decisions  α-β pruning  Imperfect, real-time decisions.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
Artificial Intelligence in Game Design
State Space 4 Chapter 4 Adversarial Games. Two Flavors Games of Perfect Information ◦Each player knows everything that can be known ◦Chess, Othello Games.
This time: Outline Game playing The minimax algorithm
1 Game Playing Chapter 6 Additional references for the slides: Luger’s AI book (2005). Robert Wilensky’s CS188 slides:
Game Playing CSC361 AI CSC361: Game Playing.
Min-Max Trees Based on slides by: Rob Powers Ian Gent Yishay Mansour.
MAE 552 – Heuristic Optimization Lecture 28 April 5, 2002 Topic:Chess Programs Utilizing Tree Searches.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Game Tree Search based on Russ Greiner and Jean-Claude Latombe’s notes.
Games & Adversarial Search Chapter 6 Section 1 – 4.
Game Playing: Adversarial Search Chapter 6. Why study games Fun Clear criteria for success Interesting, hard problems which require minimal “initial structure”
ICS-270a:Notes 5: 1 Notes 5: Game-Playing ICS 270a Winter 2003.
Game Playing State-of-the-Art  Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in Used an endgame database defining.
1 Adversary Search Ref: Chapter 5. 2 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans.
CSC 412: AI Adversarial Search
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Game Playing. Introduction Why is game playing so interesting from an AI point of view? –Game Playing is harder then common searching The search space.
Game Playing.
AD FOR GAMES Lecture 4. M INIMAX AND A LPHA -B ETA R EDUCTION Borrows from Spring 2006 CS 440 Lecture Slides.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Agents that can play multi-player games. Recall: Single-player, fully-observable, deterministic game agents An agent that plays Peg Solitaire involves.
Mark Dunlop, Computer and Information Sciences, Strathclyde University 1 Algorithms & Complexity 5 Games Mark D Dunlop.
Game-playing AIs Part 1 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part I (this set of slides)  Motivation  Game Trees  Evaluation.
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Game Playing. Towards Intelligence? Many researchers attacked “intelligent behavior” by looking to strategy games involving deep thought. Many researchers.
Minimax with Alpha Beta Pruning The minimax algorithm is a way of finding an optimal move in a two player game. Alpha-beta pruning is a way of finding.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
1 Adversarial Search CS 171/271 (Chapter 6) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Game Playing. Introduction One of the earliest areas in artificial intelligence is game playing. Two-person zero-sum game. Games for which the state space.
CSCI 4310 Lecture 6: Adversarial Tree Search. Book Winston Chapter 6.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
Game tree search Thanks to Andrew Moore and Faheim Bacchus for slides!
Game tree search Chapter 6 (6.1 to 6.3 and 6.6) cover games. 6.6 covers state of the art game players in particular. 6.5 covers games that involve uncertainty.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Graph Search II GAM 376 Robin Burke. Outline Homework #3 Graph search review DFS, BFS A* search Iterative beam search IA* search Search in turn-based.
Adversarial Search. Regular Tic Tac Toe Play a few games. –What is the expected outcome –What kinds of moves “guarantee” that?
Adversarial Search and Game Playing Russell and Norvig: Chapter 6 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2004/home.htm Prof: Dekang.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Artificial Intelligence in Game Design Board Games and the MinMax Algorithm.
Adversarial Search Chapter 5 Sections 1 – 4. AI & Expert Systems© Dr. Khalid Kaabneh, AAU Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
ADVERSARIAL SEARCH Chapter 6 Section 1 – 4. OUTLINE Optimal decisions α-β pruning Imperfect, real-time decisions.
1 Chapter 6 Game Playing. 2 Chapter 6 Contents l Game Trees l Assumptions l Static evaluation functions l Searching game trees l Minimax l Bounded lookahead.
Adversarial Search and Game-Playing
PENGANTAR INTELIJENSIA BUATAN (64A614)
CS Fall 2016 (Shavlik©), Lecture 11, Week 6
State Space 4 Chapter 4 Adversarial Games.
CSC 110 – Fluency in Information Technology Chess
NIM - a two person game n objects are in one pile
Game Playing Fifth Lecture 2019/4/11.
Adversarial Search CMPT 420 / CMPG 720.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

Today’s Topics Playing Deterministic (no Dice, etc) Games –Mini-max –  -  pruning –ML and games? 1997: Computer Chess Player (IBM’s Deep Blue) Beat Human Chess Champ (Kasparov) 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 51

Mini-Max Algorithm Generate Search Tree of ALL Possible Games Score Leaves (Assume Higher Better for ‘You’) eg, +1 you win, -1 you lose, 0 if a draw (ie, a tie) Assume Opponent Scores ‘Board Configurations’ the Same Way You Do (more on this later) Propagate Info from Leaves to Root of Search Tree, then Choose Best Move –Your Turn: choose MAX score –Opponent’s Turn: choose MIN score (which is best for opponent) Only Choose NEXT Move; When Your Turn Again, Repeat –opponent might not have done what you expected 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 2

Tic-Tac-Toe ( 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 3

What If Game More Complex? Chess: approx 35 moves per term and 50 moves/player/game, so O ( ) possible board configurations! Better estimate: en.wikipedia.org/wiki/Shannon_number en.wikipedia.org/wiki/Shannon_number Number of atoms in the Earth: Solution: project ahead as far as possible, then use a ‘static board evaluator’ (SBE) to score in-progress board configurations 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 4 (Common) Abuse of big-O notation

SBE’s No Perfect SBE Exists for Chess (otherwise we’d know if black can always win, etc) But a lot of Domain K can be put in the SBE You Might Have Learned “Piece Values” in Chess SBE = 1  (#myPawns - #theirPawns) + … + 10  (#myQueens - #theirQueens) + points for ‘center of board’ control + etc Can Run Mini-Max with SBE 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 5

Saving Unnecessary Calculations:  -  Pruning Can Prune Away Subtrees by Realizing no Matter their Score, they won’t Impact Choice We Won’t Cover the Full  -  Pruning Algorithm, Since its Applicability Across AI is Limited But We’ll Cover some Simple Cases of the Two Types of Pruning Ask: Would it Matter if this Node had Value  or Value -  ? If Decision Same in Both Cases, No Need to Compute Node’s SBE Value 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 6

An  -Cutoff Example (view in Slide Show mode to see animation) 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 7 Us (max) Them (min) big subtree ?  2 2  1 Tip: Always fully compute the left-most subtree of root If good for Us, Opponent will not go here. If bad for Us, we will take left branch from root. move

A  -Cutoff Example (view in Slide Show mode to see animation) 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 8 Us (max) Them (min) big subtree ?  7 7  9 Recall: Always compute the left-most subtree of root If good for Us, Opponent will take left branch from root. If bad for Us, we will take left branch. move

Note We project ahead as far as we can in the time we have, but only choose our next move Next time it is our turn, we repeat  -  calc (possibly repeating some work, but too much to store) 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 9

Performance Improvement Best case:  -  can double search depth considered is fixed amount of time (doubling depth exponentially increases boards considered!) Worst case: no savings Note:  -  and mini-max return SAME answer (  -  simply avoids wasted work) 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 10

Some Built-in Assumptions Projecting Ahead k Moves will Lead to Better SBE Estimates than Simply Applying SBE to the Legal Next Boards –seems reasonable, but isn’t guaranteed Our Opponent Thinks the Same Way We Do –no consideration of ‘traps’ and tricking opponent 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 11

Horizon Effect Defn: Since We Usually Stop before Game Ends, ‘Danger’ might be Lurking just Beyond our Search Depth One (Partial) Soln: Once Best Move Chosen, Look Ahead a Few Moves More if turns out bad, spend more time searching this turn 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 12

Chess: The ‘E. coli’ of AI? Chess Originally Thought to be a Great Testbed for Advancing AI Has had Moderate Impact on AI Progress Not Much ‘Technology Transfer’ to AI Tasks Played Minor Role in ‘ML Revolution’ 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 13

ML and Games ML Led to World-Class Backgammon Player Decades Ago ML Produced World-Class Poker Player Over Last Few Years Had Less Success at Chess and Go, but Recent Promise Shown with ‘Deep [Neural] Networks’ Deep Networks Recently Learned to Play Well without being given Games’ Rules 10/6/15CS Fall 2015 (Shavlik©), Lecture 12, Week 5 14