Download presentation
Presentation is loading. Please wait.
Published byPeregrine Ryan Modified over 9 years ago
1
Introduction to Artificial Intelligence Evolutionary Computing Henry Kautz
2
Announcements Midterm exam Wednesday –Bring any written notes, but not textbook –Will cover material up through neural networks –Counts for 10% of final grade Please send your team name to Ravi Readings for Friday (if any) will be posted Wednesday
3
Final Projects Express yourself Don’t follow the rules Take risks Have fun Seattle artist Monad Elohim
4
Myopic Local Search The local search methods we have discussed so far are myopic – they only look at the immediate neighborhood of a single state at any one time Simple Parallelism: run many searches in parallel with different random seeds –Prob(Success) = 1 – Prob(Run Fails) k –E.g.: Prob(Run Fails) = 90%, k = 10 Prob(Success) = 65%
5
Multi-Point Local Search We can (sometimes) do better by considering several points simultaneously and exchanging information between the search points Two biological metaphors: –Genetic algorithms –Swarm algorithms
6
Genetic algorithms A successor state is generated by combining two parent states Start with k randomly generated states (population) A state is represented as a string over a finite alphabet (often a string of 0s and 1s) Evaluation function (fitness function). Depending on problem, may want to MAXIMIZE or MINIMIZE. Produce the next generation of states by selection, crossover, and mutation
7
Example: 8-Queens Fitness function: number of non-attacking pairs of queens (min = 0, max = 8 × 7/2 = 28) 24/(24+23+20+11) = 31% 23/(24+23+20+11) = 29% etc Normalized Fitness
8
Genetic algorithms
9
Components of a GA A problem to solve, and... Encoding technique (gene, chromosome) Initialization procedure (creation) Evaluation function (environment) Selection of parents (reproduction) Genetic operators (mutation, recombination) Parameter settings (practice and art)
10
The GA Cycle of Reproduction reproduction population evaluation modification discard deleted members parents children modified children evaluated children
11
Population Chromosomes could be: –Bit strings (0101... 1100) –Real numbers (43.2 -33.1... 0.0 89.2) –Permutations of element (E11 E3 E7... E1 E15) –Lists of rules (R1 R2 R3... R22 R23) –Program elements (genetic programming) –... any data structure... population
12
Reproduction reproduction population parents children Parents are selected at random with selection chances biased in relation to chromosome evaluations
13
Chromosome Modification modification children Modifications are stochastically triggered Operator types are: –Mutation –Crossover (recombination) modified children
14
Crossover mechanisms
15
Two Authors
18
James Thurber James Grover Thurber (December 8, 1894–November 2, 1961) was a U.S. humorist and cartoonist. Thurber was best known for his contributions (both cartoons and short stories) to The New Yorker magazine. The Secret Life of Walter Mitty
19
Evaluation The evaluator decodes a chromosome and assigns it a fitness measure The evaluator is the only link between a classical GA and the problem it is solving evaluation evaluated children modified children
20
Deletion Generational GA: entire populations replaced with each iteration Steady-state GA: a few members replaced each generation population discard discarded members
21
Example: Traveling Salesman Problem Find a tour of a given set of cities so that –each city is visited only once –the total distance traveled is minimized
22
Representation Representation is an ordered list of city numbers known as an order-based GA. 1) Berlin 3) Stuttgart 5) Cologne 7) Dusseldorf 2) Munich 4) Wesbaden 6) Hanover 8) Breme CityList1 (3 5 7 2 1 6 4 8) CityList2 (2 5 7 6 8 1 3 4)
23
Mutating Permutations Changing just one entry in the permutation would give an inadmissible solution Alternative: –Pick two allele values at random –Move the second to follow the first, shifting the rest along to accommodate –Note that this preserves most of the order and the adjacency information
24
“ Normal” crossover operators will often lead to inadmissible solutions Many specialised operators have been devised which focus on combining order or adjacency information from the two parents Crossover operators for permutations 1 2 3 4 5 5 4 3 2 1 1 2 3 2 1 5 4 3 4 5
25
Order 1 Crossover Idea is to preserve relative order that elements occur Informal procedure: 1. Choose an arbitrary part from the first parent 2. Copy this part to the first child 3. Copy the numbers that are not in the first part, to the first child: starting right from cut point of the copied part, using the order of the second parent and wrapping around at the end 4. Analogous for the second child, with parent roles reversed
26
Order 1 Crossover Example Copy randomly selected set from first parent Copy rest from second parent in order 1,9,3,8,2
27
TSP Demo
28
TSP Example: 30 Cities
29
Solution i (Distance = 941)
30
Solution j (Distance = 800)
31
Solution k (Distance = 652)
32
Best Solution (Distance = 420)
33
Overview of Performance
34
Considering GA Technology “Almost eight years ago... people at Microsoft wrote a program [that] uses some genetic things for finding short code sequences. Windows 2.0 and 3.2, NT, and almost all Microsoft applications products have shipped with pieces of code created by that system.” - Nathan Myhrvold, Microsoft Advanced Technology Group, Wired, September 1995
35
Hardware & Software Optimization GA have been particularly successful for finding small circuits or code snippets that implement common functions E.g.: Sorting network – parallel circuit that sorts a fixed number of inputs using “compare / exchange” operators
36
Representation For design tasks like this, the genotype is not just a low-level bit-string, but a high- level data structure with meaningful sub- structure Software: parse tree Circuit: treat as a program –gates = functions –wires = variables
37
Fitness Function Multi-objective fitness function: –Circuit sorts correctly –Circuit is small Theorem: a sorting circuit design is correct if it is correct for 1-bit inputs Fitness (minimized) = # of (1-bit) inputs sorted incorrectly + 0.01 * circuit size
38
Computational Bottleneck Consider networks for sorting 16 numbers: every child must be tested on 2 16 inputs Cost of doing all these tests comprises nearly all of the computation time Strategies: –Parallelize evaluation of children [1,000 node cluster] –Use special hardware (FPGA) to evaluate [Koza et al 1997]
39
Results
40
Issues for GA Practitioners Design decisions: –representation –population size, mutation rate,... –selection, deletion policies –crossover, mutation operators Key open question…
42
Swarm Algorithms, Briefly Idea: –Each insect in a swarm is local search process –At each step, each insect: Looks around its neighborhood Decides which direction looks best Communicates what it found out to (some of) the other insects According to a random coin flip, –Moves in the direction that looks best locally –Moves in the best direction it hears about –Moves in some weighted combination of the above
43
Example: Particle Swarm Optimization
44
Coming Up Logical reasoning –What is logic –Search algorithms for reasoning –Applications Probabilistic reasoning and learning
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.