1 / 82

GENETIC ALGORITHMS AND GENETIC PROGRAMMING

GENETIC ALGORITHMS AND GENETIC PROGRAMMING. John R. Koza Consulting Professor (Medical Informatics) Department of Medicine School of Medicine Consulting Professor Department of Electrical Engineering School of Engineering Stanford University Stanford, California 94305 koza@stanford.edu

mgaray
Download Presentation

GENETIC ALGORITHMS AND GENETIC PROGRAMMING

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. GENETIC ALGORITHMS AND GENETIC PROGRAMMING

  2. John R. Koza Consulting Professor (Medical Informatics) Department of Medicine School of Medicine Consulting Professor Department of Electrical Engineering School of Engineering Stanford University Stanford, California 94305 koza@stanford.edu http://www.smi.stanford.edu/people/koza/

  3. DEFINITION OF THE GENETIC ALGORITHM (GA) The genetic algorithm is a probabalistic search algorithm that iteratively transforms a set (called a population) of mathematical objects (typically fixed-length binary character strings), each with an associated fitness value, into a new population of offspring objects using the Darwinian principle of natural selection and using operations that are patterned after naturally occurring genetic operations, such as crossover (sexual recombination) and mutation.

  4. GENETIC ALGORITHM (GA)

  5. HAMBURGER RESTAURANT PROBLEM • Price 1 = $ 0.50 price 0 = $10.00 price • Drink 1 = Coca Cola 0 = Wine • Ambiance 1 = Fast snappy service 0 = Leisurely service with tuxedoed waiter

  6. CHROMOSOME (GENOME) OF THE GLOBAL OPTIMUM McDONALD's

  7. THE SEARCH SPACE • Alphabet size K=2, Length L=3 • Size of search space: KL=2L=23=8

  8. IMPRACTICALITY OF RANDOM OR ENUMERATIVE SEARCH • 81-bit problems are very small for GA • However, even if L is as small as 81, 281 ~ 1027 = number of nanoseconds since the beginning of the universe 15 billion years ago

  9. GA FLOWCHART

  10. GENERATION 0

  11. DEFINITION OF THE GENETIC ALGORITHM (GA) The genetic algorithm is a probabalistic search algorithm that iteratively transforms a set (called a population) of mathematical objects (typically fixed-length binary character strings), each with an associated fitness value, into a new population of offspring objects using the Darwinian principle of natural selection and using operations that are patterned after naturally occurring genetic operations, such as crossover (sexual recombination) and mutation.

  12. PROBABILISTIC SELECTION BASED ON FITNESS • Better individuals are preferred • Best is not always picked • Worst is not necessarily excluded • Nothing is guaranteed • Mixture of greedy exploitation and adventurous exploration • Similarities to simulated annealing (SA)

  13. DARWINIAN FITNESS PROPORTIONATE SELECTION

  14. DEFINITION OF THE GENETIC ALGORITHM (GA) The genetic algorithm is a probabalistic search algorithm that iteratively transforms a set (called a population) of mathematical objects (typically fixed-length binary character strings), each with an associated fitness value, into a new population of offspring objects using the Darwinian principle of natural selection and using operations that are patterned after naturally occurring genetic operations, such as crossover (sexual recombination) and mutation.

  15. MUTATION OPERATION • Parent chosen probabilistically based on fitness • Mutation point chosen at random • One offspring

  16. AFTER MUTATION OPERATION

  17. CROSSOVER OPERATION • 2 parents chosen probabilistically based on fitness

  18. CROSSOVER (CONTINUED) • Interstitial point picked at random • 2 remainders • 2 offspring produced by crossover

  19. AFTER CROSSOVER OPERATION

  20. AFTER REPRODUCTION OPERATION

  21. DEFINITION OF THE GENETIC ALGORITHM (GA) The genetic algorithm is a probabalistic search algorithm that iteratively transforms a set (called a population) of mathematical objects (typically fixed-length binary character strings), each with an associated fitness value, into a new population of offspring objects using the Darwinian principle of natural selection and using operations that are patterned after naturally occurring genetic operations, such as crossover (sexual recombination) and mutation.

  22. GENERATION 1

  23. PROBABILISTIC STEPS • The initial population is typically random • Probabilistic selection based on fitness - Best is not always picked - Worst is not necessarily excluded • Random picking of mutation and crossover points • Often, there is probabilistic scenario as part of the fitness measure

  24. GENETIC PROGRAMMING

  25. THE CHALLENGE "How can computers learn to solve problems without being explicitly programmed? In other words, how can computers be made to do what is needed to be done, without being told exactly how to do it?"  Attributed to Arthur Samuel (1959)

  26. CRITERION FOR SUCCESS "The aim [is] ... to get machines to exhibit behavior, which if done by humans, would be assumed to involve the use of intelligence.“  Arthur Samuel (1983)

  27. Decision trees If-then production rules Horn clauses Neural nets Bayesian networks Frames Propositional logic Binary decision diagrams Formal grammars Coefficients for polynomials Reinforcement learning tables Conceptual clusters Classifier systems REPRESENTATIONS

  28. A COMPUTER PROGRAM

  29. GENETIC PROGRAMMING (GP) • GP applies the approach of the genetic algorithm to the space of possible computer programs • Computer programs are the lingua franca for expressing the solutions to a wide variety of problems • A wide variety of seemingly different problems from many different fields can be reformulated as a search for a computer program to solve the problem.

  30. GP MAIN POINTS • Genetic programming now routinely delivers high-return human-competitive machine intelligence. • Genetic programming is an automated invention machine. • Genetic programming has delivered a progression of qualitatively more substantial results in synchrony with five approximately order-of-magnitude increases in the expenditure of computer time.

  31. GP FLOWCHART

  32. A COMPUTER PROGRAM IN C int foo (int time) { int temp1, temp2; if (time > 10) temp1 = 3; else temp1 = 4; temp2 = temp1 + 1 + 2; return (temp2); }

  33. OUTPUT OF C PROGRAM

  34. PROGRAM TREE (+ 1 2 (IF (> TIME 10) 3 4))

  35. CREATING RANDOM PROGRAMS

  36. CREATING RANDOM PROGRAMS • Available functions F = {+, -, *, %, IFLTE} • Available terminals T = {X, Y, Random-Constants} • The random programs are: • Of different sizes and shapes • Syntactically valid • Executable

  37. GP GENETIC OPERATIONS • Reproduction • Mutation • Crossover (sexual recombination) • Architecture-altering operations

  38. MUTATION OPERATION

  39. MUTATION OPERATION • Select 1 parent probabilistically based on fitness • Pick point from 1 to NUMBER-OF-POINTS • Delete subtree at the picked point • Grow new subtree at the mutation point in same way as generated trees for initial random population (generation 0) • The result is a syntactically valid executable program • Put the offspring into the next generation of the population

  40. CROSSOVER OPERATION

  41. CROSSOVER OPERATION • Select 2 parents probabilistically based on fitness • Randomly pick a number from 1 to NUMBER-OF-POINTS for 1st parent • Independently randomly pick a number for 2nd parent • The result is a syntactically valid executable program • Put the offspring into the next generation of the population • Identify the subtrees rooted at the two picked points

  42. REPRODUCTION OPERATION • Select parent probabilistically based on fitness • Copy it (unchanged) into the next generation of the population

  43. FIVE MAJOR PREPARATORY STEPS FOR GP • Determining the set of terminals • Determining the set of functions • Determining the fitness measure • Determining the parameters for the run • Determining the method for designating a result and the criterion for terminating a run

  44. PREPARATORY STEPS

  45. SYMBOLIC REGRESSION POPULATION OF 4 RANDOMLY CREATED INDIVIDUALS FOR GENERATION 0

  46. x + 1 x2 + 1 2 x 0.67 1.00 1.70 2.67 SYMBOLIC REGRESSION x2 + x + 1 FITNESS OF THE 4 INDIVIDUALS IN GEN 0

  47. First offspring of crossover of (a) and (b)  picking “+” of parent (a) and left-most “x” of parent (b) as crossover points Second offspring of crossover of (a) and (b)  picking “+” of parent (a) and left-most “x” of parent (b) as crossover points Mutant of (c) picking “2” as mutation point Copy of (a) SYMBOLIC REGRESSION x2 + x + 1 GENERATION 1

  48. WALL-FOLLOWER

  49. FITNESS

  50. BEST OF GENERATION 57

More Related