Neural Heuristics For Problem Solving: Using ANNs to Develop Heuristics for the 8-Puzzle by Bambridge E. Peterson.

Slides:



Advertisements
Similar presentations
Informed search strategies
Advertisements

An Introduction to Artificial Intelligence
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 4 Jim Martin.
Solving Problem by Searching
October 1, 2012Introduction to Artificial Intelligence Lecture 8: Search in State Spaces II 1 A General Backtracking Algorithm Let us say that we can formulate.
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
Slide 1 Heuristic Search: BestFS and A * Jim Little UBC CS 322 – Search 5 September 19, 2014 Textbook § 3.6.
Mahgul Gulzai Moomal Umer Rabail Hafeez
Problem Solving by Searching
Review: Search problem formulation
Artificial Intelligence
Cooperating Intelligent Systems Informed search Chapter 4, AIMA.
Lecture 3 Informed Search CSE 573 Artificial Intelligence I Henry Kautz Fall 2001.
ITCS 3153 Artificial Intelligence Lecture 5 Informed Searches Lecture 5 Informed Searches.
Problem Solving and Search in AI Heuristic Search
CSC344: AI for Games Lecture 4: Informed search
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
State-Space Searches.
Informed Search Idea: be smart about what paths to try.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Heuristic Search In addition to depth-first search, breadth-first search, bound depth-first search, and iterative deepening, we can also use informed or.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed Search Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses.
Informed Search Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
1 Solving problems by searching 171, Class 2 Chapter 3.
Heuristic Search Andrea Danyluk September 16, 2013.
Advanced Artificial Intelligence Lecture 2: Search.
For Wednesday Read chapter 6, sections 1-3 Homework: –Chapter 4, exercise 1.
For Wednesday Read chapter 5, sections 1-4 Homework: –Chapter 3, exercise 23. Then do the exercise again, but use greedy heuristic search instead of A*
Artificial Intelligence for Games Informed Search (2) Patrick Olivier
Computer Science CPSC 322 Lecture 6 Iterative Deepening and Search with Costs (Ch: 3.7.3, 3.5.3)
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
CS 312: Algorithm Design & Analysis Lecture #37: A* (cont.); Admissible Heuristics Credit: adapted from slides by Stuart Russell of UC Berkeley. This work.
Informed Search Reading: Chapter 4.5 HW #1 out today, due Sept 26th.
Heuristic Functions. A Heuristic is a function that, when applied to a state, returns a number that is an estimate of the merit of the state, with respect.
A* optimality proof, cycle checking CPSC 322 – Search 5 Textbook § 3.6 and January 21, 2011 Taught by Mike Chiang.
Ch. 3 – Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
CE 473: Artificial Intelligence Autumn 2011 A* Search Luke Zettlemoyer Based on slides from Dan Klein Multiple slides from Stuart Russell or Andrew Moore.
CHAPTER 2 SEARCH HEURISTIC. QUESTION ???? What is Artificial Intelligence? The study of systems that act rationally What does rational mean? Given its.
G5AIAI Introduction to AI Graham Kendall Heuristic Searches.
February 18, 2016Introduction to Artificial Intelligence Lecture 8: Search in State Spaces III 1 A General Backtracking Algorithm Sanity check function.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 3: Search, A*
For Monday Read chapter 4 exercise 1 No homework.
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Review: Tree search Initialize the frontier using the starting state
For Monday Chapter 6 Homework: Chapter 3, exercise 7.
Department of Computer Science
Heuristic Search Introduction to Artificial Intelligence
Artificial Intelligence Problem solving by searching CSC 361
The A* Algorithm Héctor Muñoz-Avila.
Lecture 1B: Search.
CS 4100 Artificial Intelligence
A General Backtracking Algorithm
CPSC 322 Introduction to Artificial Intelligence
Announcements This Friday Project 1 due Talk by Jeniya Tabassum
HW 1: Warmup Missionaries and Cannibals
Informed Search Idea: be smart about what paths to try.
HW 1: Warmup Missionaries and Cannibals
CS 416 Artificial Intelligence
Informed Search Idea: be smart about what paths to try.
Informed Search.
Supplemental slides for CSE 327 Prof. Jeff Heflin
Presentation transcript:

Neural Heuristics For Problem Solving: Using ANNs to Develop Heuristics for the 8-Puzzle by Bambridge E. Peterson

question to be answered paradox to be resolved obstacle to be overcome goal to be achieved crisis to be averted challenge to be met What is a problem? (informal)

What is a problem? (formal) Formulate problem as a graph search 1.Initial state (question), goal state (answer) 2.Actions - allowable actions for a given state 3.Transition function - T(S,A) - given a state S and action A, return the resulting state S’ when A is performed in S 4.Goal test - function to test whether we’ve reached the goal 5.Path-cost function - keeps track of path cost (from Artificial Intelligence: A Modern Approach, 3rd Edition by Russell and Norvig)

S G Idea: Use explored set to keep track of expanded nodes Use frontier to store successor nodes still to be expanded Many search algorithms differ in how to store nodes in the frontier Graph Search

S G Some Examples: Breadth-first search Depth-first search Iterative-deepening Uniform cost Greedy-best first A* Iterative-deepening A* Graph Search

S G A* search order priority queue using cost function f(n) = g(n) + h(n) f(n) is a cost function g(n) : path cost to reach node (n) h(n) is the heuristic function - estimated distance to the goal A* optimal if h(n) is admissible and consistent Graph Search

Heuristics in Graph Search What is a heuristic? o General rule of thumb for solving a problem. Usually developed through experience What is an admissible heuristic? o A heuristic that never overestimates the path-cost to the goal What is a consistent heuristic? o never takes a step back (monotone) Why use heuristics? o Brute force search is slow when state space is large o Reduces number of nodes necessary to explore

N-Puzzle n = i for positive integer i sliding block puzzle, grid n - 1 tiles, 1 ‘blank space’ start in random state can move one tile at a time exchange places with the ‘blank’ space can only move up, down, left, right 8-puzzle example (right) goal state is numbers 1 through n in order, left to right, top to bottom

N-Puzzle Heuristics 8-puzzle: 9!/2 = 181,440 total states 15-puzzle: 16!/2 approximately 1 trillion states 24-puzzle: 25!/2 approximately 7.76 * states o Have fun with brute-force search in this state space Why use heuristics??? N-puzzle is a good example Something more ‘clever’ than brute force approach is needed…. Manhattan Distance - sum total of city block distance of all tiles in their current position from position in goal state Misplaced tiles - total number of tiles not in goal state position

Symbolic vs. Subsymbolic 1.symbols + rules for their arrangement in space and transformation in time (syntax) is a general definition of language 2.Infinite meaningful arrangements can be generated from a finite set of symbols 3.Natural languages 4.Formal languages Manhattan Distance is a symbolic heuristic 1.Connectionist 2.Parallel-distributed process 3.Simultaneous processing among multiple parallel channels Can we use machine learning to develop heuristics? Subsymbolic heuristics aka “Neural Heuristics”... So the goal is to develop a ‘better’ heuristic for the 8-puzzle...

Generating Training Data generated 20,000 solved instances of the 8-puzzle using Python to generate and solve states using the A*star algorithm stored the instances in MongoDB as well as.txt file for processing in Octave Note: A puzzle can be represented internally as a vector (3, 8, 2, 4, 5, 6, 1, 7, 9) - use 9 to represent the blank space. Obviously only certain operations can be performed...

Training Data Fields Example 1.State n 2.# states explored 3.# nodes added to frontier 4.MD heuristic 5.Path-cost 6.Time (on my machine) 1.8, 7, 1, 2, 9, 6, 3, 4, microseconds

General statistics MINMAXMEANSTD Path-cost MD Frontier Explored Time

Neural Heuristics The idea... Train various MLP networks with backpropagation goal is approximation (regression) Train network with different targets - o the optimal solution o the difference between the optimal solution and the manhattan distance of the state o perhaps another...

Neural Network Input 9 element input state S was transformed in a 81 element vector of 1’s and 0’s - the 9 x k + t bit equaled 1 if and only if S[k] = t Example: [2, 1, 3] = [ ] Example: [3, 2, 1] = [ ] Tried this because of the following paper: Likely Admissible and subsymbolic heuristics

Neural Networks (cont.) # hidden layers - 5, 10 and 15 learning rate set at 0.1 momentum 0.8 Number of epochs , 64 samples an epoch used tanh activation function for the hidden layer sigmoid activation function on output

Neural Networks (cont.) 13,000 samples used for training set 2,000 samples for tuning 3,000 for testing the results of the trained MLP 3,000 for ‘official’ testing in Python using A* saved weights in a.txt file tested in Python using Numpy

Preliminary Results A bit disappointing so far... For the 3,000 remaining testing samples, I compared the stats between the manhattan distance heuristic and various neural heuristics developed in training Heuristic MINMAXMEANSTD MD h* h*_md h*_md_avg h* - heuristic developed with optimal path cost as target h*_md - heuristic function developed with optimal path cost minus manhattan distance as target h*_md_avg - mean of the two above heuristics

Preliminary Results A bit disappointing so far... Examples… Using MD heuristic, takes less than 1 second to solve 10 n-puzzle examples. Average explored for these examples is 963, with 1508 nodes added to the frontier For the same puzzles, using h*, it took over 2 minutes to solve the puzzles, with an average of 27,000 nodes explored and added to the frontier Something isn’t right here...

Next Up Double check code for errors Try 9-h-1 topology, using just the state input without transformation into bit vector SVM - give Support Vector Machine a crack at it Discuss with Professor Hu Still a week left!

Questions?