CPSC 322, Lecture 16Slide 1 Stochastic Local Search Variants Computer Science cpsc322, Lecture 16 (Textbook Chpt 4.8) Oct, 11, 2013.

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Local Search Algorithms
Local Search Jim Little UBC CS 322 – CSP October 3, 2014 Textbook §4.8
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) Oct, 5, 2012.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) Sept, 11, 2013.
Department of Computer Science Undergraduate Events More
Department of Computer Science Undergraduate Events More
Slide 1 Planning: Representation and Forward Search Jim Little UBC CS 322 October 10, 2014 Textbook §8.1 (Skip )- 8.2)
CPSC 322, Lecture 16Slide 1 Stochastic Local Search Variants Computer Science cpsc322, Lecture 16 (Textbook Chpt 4.8) February, 9, 2009.
Decision Theory: Single Stage Decisions Computer Science cpsc322, Lecture 33 (Textbook Chpt 9.2) March, 30, 2009.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) January, 12, 2009.
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) February, 3, 2010.
CPSC 322, Lecture 18Slide 1 Planning: Heuristics and CSP Planning Computer Science cpsc322, Lecture 18 (Textbook Chpt 8) February, 12, 2010.
CPSC 322, Lecture 15Slide 1 Stochastic Local Search Computer Science cpsc322, Lecture 15 (Textbook Chpt 4.8) February, 6, 2009.
CPSC 322, Lecture 11Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Computer Science cpsc322, Lecture 11 (Textbook Chpt 4.0 – 4.2) January,
1 Lecture 8: Genetic Algorithms Contents : Miming nature The steps of the algorithm –Coosing parents –Reproduction –Mutation Deeper in GA –Stochastic Universal.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) February, 4, 2009.
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
Review Best-first search uses an evaluation function f(n) to select the next node for expansion. Greedy best-first search uses f(n) = h(n). Greedy best.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) March, 8, 2010.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 5 Jim Martin.
Optimization via Search CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 4 Adapted from slides of Yoonsuck Choe.
Local Search and Optimization
1 Local search and optimization Local search= use single current state and move to neighboring states. Advantages: –Use very little memory –Find often.
Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Jim Little UBC CS 322 – CSP 1 September 27, 2014 Textbook §
Stochastic Local Search CPSC 322 – CSP 6 Textbook §4.8 February 9, 2011.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 26, 2010.
An Introduction to Artificial Life Lecture 4b: Informed Search and Exploration Ramin Halavati In which we see how information.
Local Search CPSC 322 – CSP 5 Textbook §4.8 February 7, 2011.
Local Search Algorithms This lecture topic Chapter Next lecture topic Chapter 5 (Please read lecture topic material before and after each lecture.
Department of Computer Science Undergraduate Events More
Boltzmann Machine (BM) (§6.4) Hopfield model + hidden nodes + simulated annealing BM Architecture –a set of visible nodes: nodes can be accessed from outside.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
Computer Science CPSC 322 Lecture 16 CSP: wrap-up Planning: Intro (Ch 8.1) Slide 1.
Iterative Improvement Algorithm 2012/03/20. Outline Local Search Algorithms Hill-Climbing Search Simulated Annealing Search Local Beam Search Genetic.
Local Search Pat Riddle 2012 Semester 2 Patricia J Riddle Adapted from slides by Stuart Russell,
Princess Nora University Artificial Intelligence Chapter (4) Informed search algorithms 1.
Local Search and Optimization Presented by Collin Kanaley.
When A* doesn’t work CIS 391 – Intro to Artificial Intelligence A few slides adapted from CS 471, Fall 2004, UBMC (which were adapted from notes by Charles.
Announcement "A note taker is being recruited for this class. No extra time outside of class is required. If you take clear, well-organized notes, this.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) Sept, 12, 2012.
Local Search. Systematic versus local search u Systematic search  Breadth-first, depth-first, IDDFS, A*, IDA*, etc  Keep one or more paths in memory.
Chapter 5. Advanced Search Fall 2011 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Lecture 6 – Local Search Dr. Muhammad Adnan Hashmi 1 24 February 2016.
Local Search Algorithms and Optimization Problems
Domain Splitting, Local Search CPSC 322 – CSP 4 Textbook §4.6, §4.8 February 4, 2011.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 5 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
Local Search Algorithms CMPT 463. When: Tuesday, April 5 3:30PM Where: RLC 105 Team based: one, two or three people per team Languages: Python, C++ and.
Constraints Satisfaction Edmondo Trentin, DIISM. Constraint Satisfaction Problems: Local Search In many optimization problems, the path to the goal is.
Local search algorithms In many optimization problems, the path to the goal is irrelevant; the goal state itself is the solution State space = set of "complete"
CPSC 322, Lecture 15Slide 1 Stochastic Local Search Computer Science cpsc322, Lecture 15 (Textbook Chpt 4.8) Oct, 9, 2013.
Optimization via Search
CSCI 4310 Lecture 10: Local Search Algorithms
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Lecture 11 SLS wrap up, Intro To Planning
Local Search Algorithms
Planning: Representation and Forward Search
Computer Science cpsc322, Lecture 14
Artificial Intelligence (CS 370D)
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Planning: Representation and Forward Search
More on Search: A* and Optimization
Stochastic Local Search Variants Computer Science cpsc322, Lecture 16
Artificial Intelligence
Local Search Algorithms
Local Search Algorithms
Planning: Representation and Forward Search
Presentation transcript:

CPSC 322, Lecture 16Slide 1 Stochastic Local Search Variants Computer Science cpsc322, Lecture 16 (Textbook Chpt 4.8) Oct, 11, 2013

CPSC 322, Lecture 16Slide 2 Lecture Overview Recap SLS SLS variants

Announcements No office hours today. Sorry Assignmnet-2 will be posted over the weekend CPSC 322, Lecture 16Slide 3

CPSC 322, Lecture 16Slide 4 Stochastic Local Search Key Idea: combine greedily improving moves with randomization As well as improving steps, we can allow a “small probability” of: Random steps: move to a random neighbor. Random restart: reassign random values to all variables. Stop when Solution is found (in vanilla CSP …………………………) Run out of time (return best solution so far) Always keep best solution found so far

CPSC 322, Lecture 15Slide 5 Runtime Distributions 100% time t % of solved runs Which one would you use if you could wait t = t 1 ? t = t 2 ? t = t 3 ?

Runtime distributions in AIspace Let’s look at some algorithms and their runtime distributions: 1. Greedy Descent 2. Random Sampling 3. Random Walk 4. Greedy Descent with random walk Simple scheduling problem 2 in AIspace:

CPSC 322, Lecture 5Slide 7 What are we going to look at in AIspace When selecting a variable first followed by a value: Sometimes select variable: 1. that participates in the largest number of conflicts. 2. at random, any variable that participates in some conflict. 3. at random Sometimes choose value a)That minimizes # of conflicts b)at random AIspace terminology Random sampling Random walk Greedy Descent Greedy Descent Min conflict Greedy Descent with random walk Greedy Descent with random restart …..

CPSC 322, Lecture 16Slide 8 Lecture Overview Recap SLS SLS variants Tabu lists Simulated Annealing Beam search Genetic Algorithms

CPSC 322, Lecture 16Slide 9 Tabu lists To avoid search to Immediately going back to previously visited candidate To prevent cycling Maintain a tabu list of the k last nodes visited. Don't visit a poss. world that is already on the tabu list. Cost of this method depends on…..

CPSC 322, Lecture 16Slide 10 Simulated Annealing Annealing: a metallurgical process where metals are hardened by being slowly cooled. Analogy: start with a high ``temperature'': a high tendency to take random steps Over time, cool down: more likely to follow the scoring function Temperature reduces over time, according to an annealing schedule Key idea: Change the degree of randomness….

CPSC 322, Lecture 16Slide 11 Simulated Annealing: algorithm Here's how it works (for maximizing): You are in node n. Pick a variable at random and a new value at random. You generate n' If it is an improvement i.e.,, adopt it. If it isn't an improvement, adopt it probabilistically depending on the difference and a temperature parameter, T. we move to n' with probability e (h(n')-h(n))/T

CPSC 322, Lecture 16Slide 12 If it isn't an improvement, adopt it probabilistically depending on the difference and a temperature parameter, T. we move to n' with probability e (h(n')-h(n))/T

CPSC 322, Lecture 16Slide 13 Properties of simulated annealing search One can prove: If T decreases slowly enough, then simulated annealing search will find a global optimum with probability approaching 1 Widely used in VLSI layout, airline scheduling, etc. Finding the ideal cooling schedule is unique to each class of problems

CPSC 322, Lecture 16Slide 14 Lecture Overview Recap SLS SLS variants Simulated Annealing Population Based Beam search Genetic Algorithms

CPSC 322, Lecture 16Slide 15 Population Based SLS Often we have more memory than the one required for current node (+ best so far + tabu list) Key Idea: maintain a population of k individuals At every stage, update your population. Whenever one individual is a solution, report it. Simplest strategy: Parallel Search All searches are independent No information shared

CPSC 322, Lecture 16Slide 16 Population Based SLS: Beam Search Non Stochastic Like parallel search, with k individuals, but you choose the k best out of all of the neighbors. Useful information is passed among the k parallel search thread Troublesome case: If one individual generates several good neighbors and the other k-1 all generate bad successors….

CPSC 322, Lecture 16 Slide 17 Population Based SLS: Stochastic Beam Search Non Stochastic Beam Search may suffer from lack of diversity among the k individual (just a more expensive hill climbing) Stochastic version alleviates this problem: Selects the k individuals at random But probability of selection proportional to their value (according to scoring function)

CPSC 322, Lecture 16Slide 18 Stochastic Beam Search: Advantages It maintains diversity in the population. Biological metaphor (asexual reproduction): each individual generates “mutated” copies of itself (its neighbors) The scoring function value reflects the fitness of the individual the higher the fitness the more likely the individual will survive (i.e., the neighbor will be in the next generation)

CPSC 322, Lecture 16Slide 19 Lecture Overview Recap SLS SLS variants Simulated Annealing Population Based Beam search Genetic Algorithms

CPSC 322, Lecture 16Slide 20 Population Based SLS: Genetic Algorithms Start with k randomly generated individuals (population) An individual is represented as a string over a finite alphabet (often a string of 0s and 1s) A successor is generated by combining two parent individuals (loosely analogous to how DNA is spliced in sexual reproduction) Evaluation/Scoring function (fitness function). Higher values for better individuals. Produce the next generation of individuals by selection, crossover, and mutation

CPSC 322, Lecture 16 Slide 21 Genetic algorithms: Example Representation and fitness function State: string over finite alphabet Fitness function: higher value better states

CPSC 322, Lecture 16Slide 22 Genetic algorithms: Example 24/( ) = 31% 23/( ) = 29% etc Selection: common strategy, probability of being chosen for reproduction is directly proportional to fitness score

CPSC 322, Lecture 16Slide 23 Genetic algorithms: Example Reproduction: cross-over and mutation

CPSC 322, Lecture 16Slide 24 Genetic Algorithms: Conclusions Their performance is very sensitive to the choice of state representation and fitness function Extremely slow (not surprising as they are inspired by evolution!)

CPSC 322, Lecture 4Slide 25 Learning Goals for today’s class You can: Implement a tabu-list. Implement the simulated annealing algorithm Implement population based SLS algorithms: Beam Search Genetic Algorithms. Explain pros and cons of different SLS algorithms.

CPSC 322, Lecture 2Slide 26 Modules we'll cover in this course: R&Rsys Environment Problem Query Planning Deterministic Stochastic Search Arc Consistency Search Value Iteration Var. Elimination Constraint Satisfaction Logics STRIPS Belief Nets Vars + Constraints Decision Nets Markov Processes Var. Elimination Static Sequential Representation Reasoning Technique SLS

CPSC 322, Lecture 16Slide 27 Next class How to select and organize a sequence of actions to achieve a given goal… ……………… Start Planning (Chp Skip ) Assignment-2 on CSP will be out this evening (programming!)

CPSC 322, Lecture 12Slide Feedback or  Lectures Slides Practice Exercises Assignments AIspace …… Textbook Course Topics / Objectives TAs Learning Goals ……

CPSC 322, Lecture 16Slide 29 Sampling a discrete probability distribution