חיפוש בינה מלאכותית אבי רוזנפלד. סוגי חיפוש כלליים UNINFORMED SEARCH -- חיפושים לא מיודעים במרחי מצבים – BFS – DFS INFORMED SEARCH – חיפושים מיודעים –

Slides:



Advertisements
Similar presentations
Chapter 6, Sec Adversarial Search.
Advertisements

Adversarial Search Chapter 6 Sections 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Game Playing CS 63 Chapter 6
Adversarial Search Chapter 6 Section 1 – 4. Types of Games.
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
February 7, 2006AI: Chapter 6: Adversarial Search1 Artificial Intelligence Chapter 6: Adversarial Search Michael Scherger Department of Computer Science.
Games & Adversarial Search
Adversarial Search Chapter 6 Section 1 – 4. Warm Up Let’s play some games!
CS 484 – Artificial Intelligence
Adversarial Search Chapter 6 Section 1 – 4.
Adversarial Search Chapter 5.
COMP-4640: Intelligent & Interactive Systems Game Playing A game can be formally defined as a search problem with: -An initial state -a set of operators.
Adversarial Search Chapter 6. History Much of the work in this area has been motivated by playing chess, which has always been known as a "thinking person's.
Adversarial Search CSE 473 University of Washington.
Adversarial Search Chapter 6.
Artificial Intelligence for Games Game playing Patrick Olivier
Adversarial Search 對抗搜尋. Outline  Optimal decisions  α-β pruning  Imperfect, real-time decisions.
An Introduction to Artificial Intelligence Lecture VI: Adversarial Search (Games) Ramin Halavati In which we examine problems.
1 Adversarial Search Chapter 6 Section 1 – 4 The Master vs Machine: A Video.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
EIE426-AICV 1 Game Playing Filename: eie426-game-playing-0809.ppt.
G51IAI Introduction to AI Minmax and Alpha Beta Pruning Garry Kasparov and Deep Blue. © 1997, GM Gabriel Schwartzman's Chess Camera, courtesy IBM.
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.6: Adversarial Search Fall 2008 Marco Valtorta.
Adversarial Search: Game Playing Reading: Chess paper.
Games & Adversarial Search Chapter 6 Section 1 – 4.
Game Playing State-of-the-Art  Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in Used an endgame database defining.
CSC 412: AI Adversarial Search
CHAPTER 6 : 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.
1 Game Playing Why do AI researchers study game playing? 1.It’s a good reasoning problem, formal and nontrivial. 2.Direct comparison with humans and other.
Games as Game Theory Systems (Ch. 19). Game Theory It is not a theoretical approach to games Game theory is the mathematical study of decision making.
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 6 –Adversarial Search Thursday –AIMA, Ch. 6 –More Adversarial Search The “Luke.
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.
1 Adversarial Search CS 171/271 (Chapter 6) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Adversarial Search Chapter 6 Section 1 – 4. Search in an Adversarial Environment Iterative deepening and A* useful for single-agent search problems What.
CHAPTER 4 PROBABILITY THEORY SEARCH FOR GAMES. Representing Knowledge.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
CSE373: Data Structures & Algorithms Lecture 23: Intro to Artificial Intelligence and Game Theory Based on slides adapted Luke Zettlemoyer, Dan Klein,
Paula Matuszek, CSC 8520, Fall Based in part on aima.eecs.berkeley.edu/slides-ppt 1 CS 8520: Artificial Intelligence Adversarial Search Paula Matuszek.
Artificial Intelligence
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Turn-Based Games Héctor Muñoz-Avila sources: Wikipedia.org Russell & Norvig AI Book; Chapter 5 (and slides)
Adversarial Search Chapter 6 Section 1 – 4. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
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.
Adversarial Search CMPT 463. When: Tuesday, April 5 3:30PM Where: RLC 105 Team based: one, two or three people per team Languages: Python, C++ and Java.
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.
5/4/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 9, 5/4/2005 University of Washington, Department of Electrical Engineering Spring 2005.
Game Playing Why do AI researchers study game playing?
EA C461 – Artificial Intelligence Adversarial Search
By Kevin Madison and Emma Drobina
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Adversarial Search Chapter 5.
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search.
Games & Adversarial Search
Games & Adversarial Search
Game Playing Fifth Lecture 2019/4/11.
Games & Adversarial Search
Adversarial Search CMPT 420 / CMPG 720.
Adversarial Search CS 171/271 (Chapter 6)
Games & Adversarial Search
Adversarial Search Chapter 6 Section 1 – 4.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

חיפוש בינה מלאכותית אבי רוזנפלד

סוגי חיפוש כלליים UNINFORMED SEARCH -- חיפושים לא מיודעים במרחי מצבים – BFS – DFS INFORMED SEARCH – חיפושים מיודעים – Dijkstra – GREEDY – A* – – HILLCLIMBING

חיפוש נגד יריב ( משחקים ) איזה מידע יש בתוך המודל ( עץ ) איך היריב משחק ? –אופטימאלי / לא אופטימאלי איך אפשר להוריד את מרחב החיפוש – Alpha / Beta Pruning ( גיזום של העץ ) –יצירת החישוב (Evaluation function) – The Horizon Effect

4 סוגי משחקים

5 Game tree (2-player, deterministic, turns)

Minimax Create a utility function – Evaluation of board/game state to determine how strong the position of player 1 is. – Player 1 wants to maximize the utility function – Player 2 wants to minimize the utility function Minimax tree – Generate a new level for each move – Levels alternate between “max” (player 1 moves) and “min” (player 2 moves)

Minimax עץ ה Max Min Max Min

Minimax Tree Evaluation הנחה : יש פונקציה UTILITY ( לא הנחה פשוטה ) כל צד רוצה למקסם את הצד שלו יש מספיק מידע בתוך העץ לעשות את החישובים

עץ של המשחק (Minimax) Max Min Max Min

עץ של המשחק (Minimax) Max Min Max Min

עץ של המשחק (Minimax) Max Min Max Min

עץ של המשחק (Minimax) Max Min Max Min

Minimax Evaluation Given average branching factor b, and depth m: – A complete evaluation takes time b m – A complete evaluation takes space bm Usually, we cannot evaluate the complete state, since it’s too big Instead, we limit the depth based on various factors, including time available.

14 עוד דוגמא של Minimax

גיזום של α-β אני יודע שאתה יודע שאני יודע... שווה להוריד אופציות כדי שאפשר לחפש יותר הפתרון : גיזום –כל צד מוריד דבר שהוא בטוח שהצד השני

 α ו ל α : ( שמחפשים )MAX, אם הערך הנוכחי קטן מערך בענף אחר, תוריד את הענף (PRUNE) ל β, ( שמחפשים )MIN, אם הערך הנוכחי גדול מערך בענף אחר, תוריד את הענף (PRUNE)

17 α-β pruning example

18 α-β pruning example

19 α-β pruning example

20 α-β pruning example

21 α-β pruning example

 Cut example Max Min

 Cut example Depth first search along path Max Min

 Cut example 21 is minimum so far (second level) Can’t evaluate yet at top level Max Min 21

 Cut example -3 is minimum so far (second level) -3 is maximum so far (top level) Max Min -3

 Cut example 12 is minimum so far (second level) -3 is still maximum (can’t use second node yet) Max Min -3 12

 Cut example -70 is now minimum so far (second level) -3 is still maximum (can’t use second node yet) Max Min

 Cut example Since second level node will never be > -70, it will never be chosen by the previous level We can stop exploring that node Max Min

 Cut example Evaluation at second level is Max Min

 Cut example Again, can apply  cut since the second level node will never be > -73, and thus will never be chosen by the previous level Max Min

 Cut example As a result, we evaluated the Max node without evaluating several of the possible paths Max Min

 cuts Similar idea to  cuts, but the other way around If the current minimum is less than the successor’s max value, don’t look down that max tree any more

 Cut example Some subtrees at second level already have values > min from previous, so we can stop evaluating them Min Max

עובד  -  Pruning למה לצד של MAX, 70 יותר טוב אבל, אין מצב ש MIN ייקח אותו במקום

 -  Pruning היתרון ל אין השפעה על תוצאת MINIMAX –כן עוזר לרדת יותר עמוק בתוך העץ מאוד תלוי ב " מזל " בסידור של העץ –במצב הכי טוב, הוא מכפיל הגודל שאפשר לחפש בו

איך בונים את העצים ?! מאוד תלוי במשחק יש צורך לראות את ה - כ - ל עד סוף המשחק (!) ברמה הפשוטה : 1 אם אני מנצח, 1- אם אתה מנצח, 0 במצב תיקו. ברוב המשחקים יש ה - ר - ב - ה מצבים באמצע –שמחט –דמקה –רצף ארבע (!)

בניית פונקציות UTILITY למשחק לכל מצב יש ציון בשחמט מלכה שווה 10, אביר שווה 3 וכו ' בהרבה מקרים, הערכים הסתברותיים. – utility =  a +  b +  c

For chess, typically linear weighted sum of features Eval(s) = w 1 f 1 (s) + w 2 f 2 (s) + … + w n f n (s) e.g., w 1 = 9 with f 1 (s) = (number of white queens) – (number of black queens), etc. 38 Utility Function

לא ניתן לראות קדימה עד סוף המשחק ( אין סוף ) בונים עוץ בגודל מסויים (Cut Off) בלי גיזום ALPHA BETA, ה Cut Off בשחמט למחשב נורמאלי הוא " רק " גובה של 4 –שזה שווה לבנאדם רגיל אם ALPHA BETA, זה מגיע ל 8! אבל Kasparov ו Deep Blue עבדו עד לגובה של הגבלות בפועל

הערכים לא משפעים על איזה פעולה לעשות ! 40 בהרבה מקרים גם הערכה היא " מספיק טובה "

Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in Used a precomputed endgame database defining perfect play for all positions involving 8 or fewer pieces on the board, a total of 443,748,401,247 positions. A precomputed endgame database? Would it be possible to extend the “endgame” all the way back to the beginning of the game, essentially “solving” checkers? 41 Deterministic games in practice

Originally published in Science Express on 19 July 2007 Science 14 September 2007: Vol. 317, no. 5844, pp – 1522 Jonathan Schaeffer (University of Alberta), Neil Burch, Yngvi Björnsson, Akihiro Kishimoto, Martin Müller, Robert Lake, Paul Lu, Steve Sutphen The game of checkers has roughly 500 billion billion possible positions (5 x ). The task of solving the game, determining the final result in a game with no mistakes made by either player, is daunting. Since 1989, almost continuously, dozens of computers have been working on solving checkers, applying state-of-the-art artificial intelligence techniques to the proving process. This paper announces that checkers is now solved: Perfect play by both sides leads to a draw. This is the most challenging popular game to be solved to date, roughly one million times as complex as Connect Four. Artificial intelligence technology has been used to generate strong heuristic-based game-playing programs, such as Deep Blue for chess. Solving a game takes this to the next level by replacing the heuristics with perfection. 42 Checkers is Solved

Chess: Deep Blue defeated human world champion Garry Kasparov in a six-game match in Deep Blue searches 200 million positions per second, uses very sophisticated evaluation, and undisclosed methods for extending some lines of search up to 40 ply. Rybka was the 2008 and 2009 computer chess champion (uses an off-the-shelf 8-core 3.2GHz Intel Xeon processor), but was stripped of its titles for having plagiarized two other programs… Othello: Logistello beats human world champion in 1997; human champions refuse to compete against computers, who are too good Go: human champions refuse to compete against computers, who are too bad. In go, b > 300, so most programs use pattern knowledge bases to suggest plausible moves. 43 Deterministic games in practice

משחקים הם לא משחק ילדים לאנשי מערכות מידע... איך הסוכן שלכם יעבוד !!! 44 סיכום