1 / 38

Developing a Generic Genetic Algorithm

Developing a Generic Genetic Algorithm. Melvin Neville & Anaika Sibley Northern Arizona University Flagstaff, AZ 86011. Introduction. Melvin Neville, CSE faculty Artificial Life Evolution of intelligence Biological neural net modeling Anaika Sibley, CSE student ASCI-PALS research (DOE).

zubin
Download Presentation

Developing a Generic Genetic Algorithm

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. Developing a Generic Genetic Algorithm Melvin Neville & Anaika Sibley Northern Arizona University Flagstaff, AZ 86011 Neville & Sibley: SIGAda Houston

  2. Introduction • Melvin Neville, CSE faculty • Artificial Life • Evolution of intelligence • Biological neural net modeling • Anaika Sibley, CSE student • ASCI-PALS research (DOE) Neville & Sibley: SIGAda Houston

  3. Introduction • CSE 470: Introduction to Intelligent Systems • Neural Nets, Fuzzy Logic, Genetic Algorithms • Building tools Neville & Sibley: SIGAda Houston

  4. Outline • Introduction: Who we are and context • Genetic and Evolutionary Algorithms • Biological analogies • Genetic vs Evolutionary Algorithms • Our version • Sine function model • Conclusions: algorithm, teaching, Ada Neville & Sibley: SIGAda Houston

  5. Genetic and Evolutionary Algorithms: Biological Analogies • Biological inspiration: evolution and Mendelian genetics • Gene and Allele – Parameter variations • Chromosome – Linkage among parameters • Mutation – Allele alterations • Crossover – evading local minima Neville & Sibley: SIGAda Houston

  6. Biological Analogies • Biological inspiration: evolution and Mendelian genetics • Evolution: • Selection and “fitness” • Role of chance? • Problem of local minima (maxima) Neville & Sibley: SIGAda Houston

  7. Biological Analogies Chromosomes and Genes Neville & Sibley: SIGAda Houston

  8. Biological Analogies and Crossover Neville & Sibley: SIGAda Houston

  9. Biological Analogies • Evolutionary Paradigm: The cycle • Selection among variants • “More fit”: Better chance to survive to reproduce • Their alleles more represented • Mutation and crossover increase variation Neville & Sibley: SIGAda Houston

  10. Genetic vs Evolutionary Algorithms • Major distinctions per Michalewicz • Representation: • GA: Bit vector • ES: Floating-point vector • Selection: • GA: Repetitive random selection with fitness influence • ES: Fitness function without replacement Neville & Sibley: SIGAda Houston

  11. Genetic vs Evolutionary Algorithms • Major distinctions per Michalewicz (cont.) • Timing of mutation and crossover: • GA: After next generation selected • ES: Before next generation selected • Probabilities of mutation and crossover: • GA: Constant • ES: Can alter from generation to generation Neville & Sibley: SIGAda Houston

  12. Genetic vs Evolutionary Algorithms • Major distinctions per Michalewicz (cont.) • Handling “illegal” offspring: • GA: Penalize re fitness • ES: Discard or Impossible Neville & Sibley: SIGAda Houston

  13. Our Version • Our algorithm: • 1. Initialize the generation counter to 0 • 2. Initialize the population of entities • 3. Iterate through generations until some stopping criterion met Neville & Sibley: SIGAda Houston

  14. Our Version • Our algorithm: • 3. Iterate through generations • 3.1 Increment generation counter • 3.2 Each “winner” produces same # children • 3.3 Each child subject to chance mutation • 3.4 Each child has chance of crossover • 3.5 The children are evaluated • 3.6 The most fit are selected for the next generation (“winners”) Neville & Sibley: SIGAda Houston

  15. Our Version • Our parameters and data structures: • NumWin • ChildPerWin • Winners list • Children list • PriorityQueue Neville & Sibley: SIGAda Houston

  16. Our Version • Our parameters and data structures: mutate cross eval (2) init (3.3) (3.4) (3.5) (3.2) create children to next generation (3.6) (3.6) select Winners list Children list Priority Queue Neville & Sibley: SIGAda Houston

  17. The Sine Function Model • Taylor’s series: f(y+h) = h0f(y)/0! + h1f’(y)/1! + h2f’’(y)/2! + h3f’’’(y)/3! + h4f’’’’(y)/4! + … • Sine series: sin x = x1/1! – x3/3! + x5/5! – x7/7! + … Neville & Sibley: SIGAda Houston

  18. The Sine Function Model • Problem: to “evolve” the coefficients of the Sine Series • Subproblems: • Initial coefficient values? • Evaluation of “fitness”? • Interpretation of mutation? • Interpretation of crossover? Neville & Sibley: SIGAda Houston

  19. The Sine Function Model • Initial coefficient values? • Set to zero (they go in both directions) Neville & Sibley: SIGAda Houston

  20. The Sine Function Model • Evaluation of fitness? • Formula: Coefficients evaluated every N (5) degrees range 0 .. 90 degrees: sum square divergences from math library sin() • Evaluation with initial coefficients of 0.0: 9.5000 Neville & Sibley: SIGAda Houston

  21. The Sine Function Model • Evaluation of fitness? • Evaluation with “perfect” coefficients: 0.0000 • The “perfect” Coefficients (power of x): 0 => 0.0000000 4 => 0.0000000 1 => 1.0000000 5 => 0.0083333 2 => 0.0000000 6 => 0.0000000 3 => -0.1666667 7 => -0.0001984 Neville & Sibley: SIGAda Houston

  22. The Sine Function Model • Interpretation of mutation? • 0 .. multiple genes can be selected • Alteration in coefficients by +/- delta-values • Delta-coefficient file: 0 => 0.1 4 => 0.002 1 => 0.05 5 => 0.0004 2 => 0.02 6 => 0.00006 3 => 0.008 7 => 0.00001 Neville & Sibley: SIGAda Houston

  23. The Sine Function Model • Interpretation of crossover? • Random choice of organisms involved • Random choice of pairings • Random choice of single point of breakage Neville & Sibley: SIGAda Houston

  24. Lessons Learned: The Algorithm • Parameters of run: • NumWin = 20 Winners, ChildPerWin = 20 • 20000 maximum cycles • Eval at end: 0.000456 (start: 9.5000) • Coefs: 0 => -0.0000000 -0.0000000 1 => 0.9500000 1.0000000 2 => 0.0600000 0.0000000 3 => -0.1360000 -0.1666667 Neville & Sibley: SIGAda Houston

  25. Lessons Learned: Parameters • Change the Parameter Values • Vary the number of Winners • Vary the number of Children • Create Multiple Runs • Graph Results Neville & Sibley: SIGAda Houston

  26. Seven Differing Runs Neville & Sibley: SIGAda Houston

  27. Seven Differing Children Neville & Sibley: SIGAda Houston

  28. Lessons Learned: The Algorithm • Breakdown of the evaluation: Angle (deg) Evolved sin Library sin 0 0.0000 0.0000 5 0.0833 0.0872 10 0.1669 0.1736 30 0.4921 0.5000 60 0.8691 0.8660 90 1.0015 1.000028 Neville & Sibley: SIGAda Houston

  29. Lessons Learned: The Algorithm • Need to change deltas • Need to shake free of local minima • Change crossover mechanism? • Alter population sizes? • Domain knowledge very important Neville & Sibley: SIGAda Houston

  30. Lessons Learned: Ada • Hard typing • Linked-list structure • Generics Neville & Sibley: SIGAda Houston

  31. Lessons Learned: Ada • Hard typing: • Student reaction (C++ and Java) • The compiler as (stern) friend Neville & Sibley: SIGAda Houston

  32. Lessons Learned: Ada • Linked-list Updating problem: Node contents = pointer (thru GetContents()) Node Node Contents Contents Real_Contents Real_Contents Neville & Sibley: SIGAda Houston

  33. Lessons Learned: Ada • Linked-list Updating problem: Copy node contents (thru Get/SetContents()) Update fields GetContents() Copy of Contents SetContents() Node Contents Neville & Sibley: SIGAda Houston

  34. Lessons Learned: Ada • Linked-list Updating problem: Direct access to (non-encapsulated) Contents Node Contents Neville & Sibley: SIGAda Houston

  35. Lessons Learned: Ada • Generics: • Powerful but complicated • Allow tying together complicated instantiation relationships • (see paper) Neville & Sibley: SIGAda Houston

  36. Conclusions • Genetic Algorithms potentially powerful • Final results may be stall at local minimum • Domain knowledge important • Ada: definite strengths • Ada: particular problems Neville & Sibley: SIGAda Houston

  37. The Sine Function Model • Taylor’s series: f(y+h) = h0f(y)/0! + h1f’(y)/1! + h2f’’(y)/2! + h3f’’’(y)/3! + h4f’’’’(y)/4! + … • Euler’s formula: eix = cos x + i sin x • Substitute: • Euler’s formula with y=z,h=ix => eixez • Evaluate at z = 0 Neville & Sibley: SIGAda Houston

  38. The Sine Function Model • Substitute: f(z + ix)z=0 = cos x + i sin x = (ix)0ez/0! + (ix)1ez/1! + (ix)2ez/2! – (ix)3ez/3! + (ix)4ez/4! + … sin(x) = i-terms = x1/1! – x3/3! + x 5/5! - … Neville & Sibley: SIGAda Houston

More Related