Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Machine Learning Lecture 4: Greedy Local Search (Hill Climbing)

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Informed search algorithms
Local Search and Optimization
Local Search Algorithms
Informed search algorithms
LOCAL SEARCH AND CONTINUOUS SEARCH. Local search algorithms  In many optimization problems, the path to the goal is irrelevant ; the goal state itself.
Problem Solving by Searching
CSC344: AI for Games Lecture 5 Advanced heuristic search Patrick Olivier
Local search algorithms
Local search algorithms
Two types of search problems
Optimization via Search CPSC 315 – Programming Studio Spring 2009 Project 2, Lecture 4 Adapted from slides of Yoonsuck Choe.
CS 460 Spring 2011 Lecture 3 Heuristic Search / Local Search.
CS 4700: Foundations of Artificial Intelligence
Trading optimality for speed…
CSC344: AI for Games Lecture 4: Informed search
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 5 Jim Martin.
Informed Search Next time: Search Application Reading: Machine Translation paper under Links Username and password will be mailed to class.
Optimization via Search CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 4 Adapted from slides of Yoonsuck Choe.
Constraint Satisfaction Problems
Informed search algorithms
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.
When A* fails – Hill climbing, simulated annealing Genetic algorithms
Search CSE When you can’t use A* Hill-climbing Simulated Annealing Other strategies 2 person- games.
INTRODUÇÃO AOS SISTEMAS INTELIGENTES Prof. Dr. Celso A.A. Kaestner PPGEE-CP / UTFPR Agosto de 2011.
An Introduction to Artificial Life Lecture 4b: Informed Search and Exploration Ramin Halavati In which we see how information.
Local Search Algorithms This lecture topic Chapter Next lecture topic Chapter 5 (Please read lecture topic material before and after each lecture.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Informed search algorithms
Informed search algorithms
1 Shanghai Jiao Tong University Informed Search and Exploration.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
ISC 4322/6300 – GAM 4322 Artificial Intelligence Lecture 3 Informed Search and Exploration Instructor: Alireza Tavakkoli September 10, 2009 University.
Iterative Improvement Algorithm 2012/03/20. Outline Local Search Algorithms Hill-Climbing Search Simulated Annealing Search Local Beam Search Genetic.
Artificial Intelligence for Games Online and local search
Local Search Algorithms
Local Search Pat Riddle 2012 Semester 2 Patricia J Riddle Adapted from slides by Stuart Russell,
CHAPTER 4, Part II Oliver Schulte Summer 2011 Local Search.
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.
4/11/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 4, 4/11/2005 University of Washington, Department of Electrical Engineering Spring 2005.
A General Introduction to Artificial Intelligence.
Feng Zhiyong Tianjin University Fall  Best-first search  Greedy best-first search  A * search  Heuristics  Local search algorithms  Hill-climbing.
Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most desirable unexpanded node Implementation:
Local search algorithms In many optimization problems, the state space is the space of all possible complete solutions We have an objective function that.
Local Search Algorithms This lecture topic (two lectures) Chapter Next lecture topic Chapter 5 (Please read lecture topic material before and after.
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.
Chapter 4 (Section 4.3, …) 2 nd Edition or Chapter 4 (3 rd Edition) Local Search and Optimization.
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
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 and Optimization Chapter 4 Mausam (Based on slides of Padhraic Smyth, Stuart Russell, Rao Kambhampati, Raj Rao, Dan Weld…) 1.
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.
Local Search Goal is to find the local maximum (or minimum) Example: – # seconds to spin wheels at 1.0 to move 2.0 meters.
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"
Games: Expectimax MAX MIN MAX Prune if α ≥ β. Games: Expectimax MAX MIN MAX
Department of Computer Science
Local Search Algorithms
Artificial Intelligence (CS 370D)
Local Search and Optimization
Artificial Intelligence
First Exam 18/10/2010.
Local Search Algorithms
CSC 380: Design and Analysis of Algorithms
Beyond Classical Search
Local Search Algorithms
Presentation transcript:

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Machine Learning Lecture 4: Greedy Local Search (Hill Climbing)

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Local search algorithms We’ve discussed ways to select a hypothesis h that performs well on training examples, e.g. –Candidate-Elimination –Decision Trees Another technique that is quite general: –Start with some (perhaps random) hypothesis h –Incrementally improve h Known as local search

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Example: n-queens Put n queens on an n × n board with no two queens on the same row, column, or diagonal

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Hill-climbing search "Like climbing Everest in thick fog with amnesia“ h = initialState loop: h’ = highest valued Successor(h) if Value(h) >= Value(h’) return h else h = h’

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Hill-climbing search Problem: depending on initial state, can get stuck in local maxima

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Underfitting Overfitting: Performance on test examples is much lower than on training examples Underfitting: Performance on training examples is low Two leading causes: –Hypothesis space is too small/simple –Training algorithm (i.e., hypothesis search algorithm) stuck in local maxima

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Hill-climbing search: 8-queens problem v = number of pairs of queens that are attacking each other, either directly or indirectly v =17

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Hill-climbing search: 8-queens problem A local minimum with v = 1

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Simulated annealing search Idea: escape local maxima by allowing some "bad" moves but gradually decrease their frequency h = initialState T = initialTemperature loop: h’ = random Successor(h) if (  V = Value(h’)-Value(h)) > 0 h = h’ else h = h’ with probability e  V/T decrease T; if T==0, return h

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Properties of simulated annealing 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

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Local beam search Keep track of k states rather than just one Start with k randomly generated states At each iteration, all the successors of all k states are generated If any one is a goal state, stop; else select the k best successors from the complete list and repeat.

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Gradient Descent Hill Climbing and Simulated Annealing are “generate and test” algorithms –Successor function generates candidates, Value function helps select In some cases, we can do much better: –Define: Error(training data D, hypothesis h) –If h is represented by parameters w 1,…w n and dError/dw i is known, we can compute the error gradient, and descend in the direction that is (locally) steepest

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349

About distance…. Clustering requires distance measures. Local methods require a measure of “locality” Search engines require a measure of similarity So….when are two things close to each other?

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Euclidean Distance What people intuitively think of as “distance” Dimension 1: x Dimension 2: y

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Generalized Euclidean Distance

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Weighting Dimensions Apparent clusters at one scaling of X are not so apparent at another scaling

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Weighted Euclidean Distance You can, of course compensate by weighting your dimensions….

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 More Generalization: Minkowsky metric My three favorites are special cases of this:

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 What is a “metric”? A metric has these four qualities. …otherwise, call it a “measure”

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Metric, or not? Driving distance with 1-way streets Categorical Stuff : –Is distance Jazz -> Blues -> Rock no less than distance Jazz -> Rock?

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 What about categorical variables? Consider feature vectors for genre & vocals –Genre: {Blues, Jazz, Rock, Zydeco} –Vocals: {vocals,no vocals} s1 = {rock, vocals} s2 = {jazz, no vocals} s3 = { rock, no vocals} Which two songs are more similar?

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Binary Features + Hamming distance s1 = {rock, yes} s2 = {jazz, no} s3 = { rock, no vocals} BluesJazzZydecoRockVocals Hamming Distance = number of bits different between binary vectors

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Hamming Distance

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Other approaches… Define your own distance: f (a,b) BeethovenBeatlesLiz Phair Beethoven700 Beatles450 Liz Phair?12 Quote Frequency

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Missing data What if, for some category, on some examples, there is no value given? Approaches: –Discard all examples missing the category –Fill in the blanks with the mean value –Only use a category in the distance measure if both examples give a value

Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Dealing with missing data