1 / 24

CS26110 AI Toolbox

CS26110 AI Toolbox. Evolutionary and Genetic Algorithms 2. GA Megaman controller http://www.youtube.com/watch?v=c7xJNAJys2s Procedural animation via GAs http://www.youtube.com/watch?v=_v9_hTSOHN4 Starcraft 2 build orders

Download Presentation

CS26110 AI Toolbox

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS26110AI Toolbox Evolutionary and Genetic Algorithms 2

  2. GA Megaman controller • http://www.youtube.com/watch?v=c7xJNAJys2s • Procedural animation via GAs • http://www.youtube.com/watch?v=_v9_hTSOHN4 • Starcraft 2 build orders • http://lbrandy.com/blog/2010/11/using-genetic-algorithms-to-find-starcraft-2-build-orders/ • Evolving locomotion • http://www.youtube.com/watch?v=STkfUZtR-Vs

  3. Basic ideas of EAs • An EA is an iterative procedure which evolves a population of individuals • Each individual is a candidate solution to a given problem • Each individual is evaluated by a fitness function, which measures the quality of its candidate solution • At each iteration (generation): • The best individuals are selected • Genetic operators are applied to selected individuals in order to produce new individuals (offspring) • New individuals are evaluated by fitness function

  4. Representation CHROMOSOME GENE 0.12 1 A 0.33 0 C B 1 5.2 0 -1.2 C W 3.0 0 1.18 0 W 1 20.4 Q S 1 5.2

  5. Task • The knapsack problem is as follows: • given a set of weights W, and a target weight T, find a subset of W whose sum is as close to T as possible • Example: W = {5, 8, 10, 23, 27, 31, 37, 41} and T = 82 • 1. Solve the instance of the knapsack problem given above • 2. How can a solution be encoded as a (binary) chromosome?

  6. Task • 1. Solve the instance of the knapsack problem given above... • 82 = 41+31+10 is one solution, there may be others • 2. How can a solution be encoded as a (binary) chromosome? • Each bit i in a chromosome encodes whether weight w[i] is present or not • Solution above: {5, 8, 10, 23, 27, 31, 37, 41} [0, 0, 1, 0, 0, 1, 0, 1]

  7. The GA cycle chosen parents recombination children selection modification modified children parents evaluation population evaluated children deleted members discard

  8. Mutation: local modification • Causes movement in the search space • Restores lost information to the population Before: (1 0 1 1 0 1 1 0) After: (1 0 1 0 0 1 1 0) Before: (1.38 -69.4 326.44 0.1) After: (1.38 -67.5 326.44 0.1)

  9. Mutation • Given the representation for TSPs, how could we achieve mutation?

  10. Mutation For TSPs, involves reordering of the list: ** Before: (5 8 7 2 1 6 3 4) After: (5 8 6 2 1 7 3 4)

  11. Note • Both mutation and crossover are applied based on user-supplied probabilities • We usually use a fairly high crossover rate and fairly low mutation rate • Why do you think this is?

  12. Evaluation of fitness • 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 modified children evaluation evaluated children

  13. Fitness functions • Evaluate the ‘goodness’ of chromosomes • (How well they solve the problem) • Critical to the success of the GA • Often difficult to define well • Must be fairly fast, as every chromosome must be evaluated each generation (iteration)

  14. Fitness functions • Fitness function for the TSP? • (3 5 7 2 1 6 4 8) • As we’re minimizing the distance travelled, the fitness is the total distance travelled in the journey defined by the chromosome

  15. Fitness functions • The knapsack problem: fitness function? • given a set of weights W, and a target weight T, find a subset of W whose sum is as close to T as possible • Example: W = {5, 8, 10, 23, 27, 31, 37, 41} and T = 82

  16. Deletion • Generational GA:entire populations replaced with each iteration • Steady-state GA:a few members replaced each generation population deleted members discard

  17. The GA cycle chosen parents recombination children selection modification modified children parents evaluation population evaluated children deleted members discard

  18. Stopping! • The GA cycle continues until • The system has ‘converged’; or • A specified number of iterations (‘generations’) has been performed

  19. Good demo of the GA components • http://www.obitko.com/tutorials/genetic-algorithms/example-function-minimum.php

  20. An abstract example Distribution of Individuals in Generation 0 Distribution of Individuals in Generation N

  21. Overview of performance

  22. Examples • Eaters • http://math.hws.edu/xJava/GA/ • TSP • http://www.heatonresearch.com/articles/65/page1.html • http://www.ads.tuwien.ac.at/raidl/tspga/TSPGA.html • Good demo of the GA components • http://www.obitko.com/tutorials/genetic-algorithms/example-function-minimum.php

  23. Issues for GA practitioners • Choosing basic implementation issues: • Representation • Population size, mutation rate, ... • Selection, deletion policies • Crossover, mutation operators • Termination criteria • Performance, scalability • Solution is only as good as the fitness function (often hardest part)

  24. Benefits of GAs • Concept is easy to understand • Supports multi-objective optimization • Good for “noisy” environments • Always an answer; answer gets better with time • Inherently parallel; easily distributed

More Related