1 / 87

Genetic Algorithm and Genetic Programming

Genetic Algorithm and Genetic Programming. Crossovers in Nature. Two parental chromosomes exchange part of their genetic information to create new hybrid combinations (recombinant). No loss of genes, but an exchange of genes between two previous chromosomes.

muncel
Télécharger la présentation

Genetic Algorithm 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 Algorithm and Genetic Programming

  2. Crossovers in Nature • Two parental chromosomes exchange part of their genetic information to create new hybrid combinations (recombinant). • No loss of genes, but an exchange of genes between two previous chromosomes. • No new genes created, preexisting old ones mixed together.

  3. What are evolutionary algorithms and Genetic Algorithm (GA)? ROBOTICS Artificial Intelligence Machine learning evolutionary GP EP GA ES Artificial Intelligence

  4. Genetic Algorithms

  5. Genetic Algorithms • 1. Randomly initialize a population of chromosomes. • 2. While the terminating criteria have not been satisfied: • a. Evaluate the fitness of each chromosome: • i. Construct the phenotype (e.g. simulated robot) corresponding to the encoded genotype (chromosome). • ii. Evaluate the phenotype (e.g. measure the simulated robot’s walking abilities), in order to determine its fitness. • b. Remove chromosomes with low fitness. • c. Generate new chromosomes, using certain selection schemes and genetic operators.

  6. Genetic Algorithms • Fitness function • Selection scheme • Genetic operators • Crossover • Mutation • Create bitstrings • Evaluate bitstrings (genotype) • Transform bitstrings to robot behaviors (phenotype)

  7. Crossover and mutation.

  8. Agenda • What is Genetic Programming? • Background/History. • Why Genetic Programming? • How Genetic Principles are Applied. • Examples of Genetic Programs. • Future of Genetic Programming.

  9. Most widely used Robust uses 2 separate spaces search space - coded solution (genotype) solution space - actual solutions (phenotypes) Genetic Algorithms Genotypes must be mapped to phenotypes before the quality or fitness of each solution can be evaluated

  10. Evolutionary Strategies

  11. Like GP no distinction between search and solution space Individuals are represented as real-valued vectors. Simple ES one parent and one child Child solution generated by randomly mutating the problem parameters of the parent. Susceptible to stagnationat local optima Evolutionary Strategies

  12. Evolutionary Strategies (cont’d) • Slow to converge to optimal solution • More advanced ES • have pools of parents and children • Unlike GA and GP, ES have these properties: • ES Separates parent individuals from child individuals • ES Selects its parent solutions deterministically

  13. Evolutionary Programming

  14. Evolutionary Programming • Resembles ES, developed independently • Early versions of EP applied to the evolution of transition table of finite state machines • One population of solutions, reproduction is by mutation only • Like ES operates on the decision variable of the problem directly (ieGenotype = Phenotype) • Tournament selection of parents • better fitness more likely a parent • children generated until population doubled in size • everyone evaluated and the half of population with lowest fitness deleted.

  15. General Architecture of Evolutionary Algorithms

  16. Genetic Programming

  17. Genetic Programming • John Koza, 1992 • Evolve program instead of bitstring • Lispprogram structure is best suited • Genetic operators can do simple replacements of sub-trees • All generated programs can be treated as legal (no syntax errors) Please review about Behavioral systems, Genetic Algorithms and Genetic Programming from the book. Chapters 20, 21, 22, 23.

  18. Specialized form of GA Manipulates a very specific type of solution using modified genetic operators Original application was to design computer programs Now applied in alternative areas eg. Analog Circuits Does not make distinction between search and solution space. Solution represented in very specific hierarchical manner. Genetic Programming

  19. Background/History • By John R. Koza, Stanford University. • 1992, Genetic Programming Treatise - “Genetic Programming. On the Programming of Computers by Means of Natural Selection.” - Origin of GP. • Combining the idea of machine learning and evolved tree structures.

  20. Why Genetic Programming? • It saves time by freeing the human from having to design complex algorithms. • Not only designing the algorithms but creating ones that give optimal solutions. • Again, Artificial Intelligence.

  21. What Constitutes a Genetic Program? • Starts with "What needs to be done" • Agent figures out "How to do it" • Produces a computer program - “Breeding Programs” • Fitness Test • Code reuse • Architecture Design - Hierarchies • Produce results that are competitive with human produced results

  22. How are Genetic Principles Applied? • “Breeding” computer programs. • Crossovers. • Mutations. • Fitness testing.

  23. Computer Programs as Trees • Infix/Postfix • (2 + a)*(4 - num) * - + 2 a 4 num

  24. “Breeding” Computer Programs Hmm hmm heh. Hey butthead. Do computer programs actually score?

  25. “Breeding” Computer Programs • Start off with a large “pool” of random computer programs. • Need a way of coming up with the best solution to the problem using the programs in the “pool” • Based on the definition of the problem and criteria specified in the fitness test, mutations and crossovers are used to come up with new programs which will solve the problem.

  26. The Fitness Test

  27. The Fitness Test • Identifying the way of evaluating how good a given computer program is at solving the problem at hand. • How good can a program cope with its environment. • Can be measured in many ways, i.e. error, distance, time, etc…

  28. Fitness Test Criteria • Time complexity a good criteria. • i.e. n2vs.n logn. • “How long to find the solution?” • Accuracy - Values of variables. • “How good is the solution?” • Combinations of criteria may also be tested.

  29. Mutations

  30. Mutations in Nature Properties of mutations • Ultimate source of genetic variation. • Radiation, chemicals change genetic information. • Causes new genes to be created. • One chromosome. • Asexual. • Very rare. Before: acgtactggctaa After: acatactggctaa

  31. Genetic Programming • 1. Randomly generate a combinatorial set of computer programs. • 2. Perform the following steps iteratively until a termination criterion is satisfied • a. Execute each program and assign a fitness value to each individual. • b. Create a new population with the following steps: • i. Reproduction: Copy the selected program unchanged to the new population. • ii. Crossover: Create a new program by recombining two selected programs at a random crossover point. • iii. Mutation: Create a new program by randomly changing a selected program. • 3. The best sets of individuals are deemed the optimal solution upon termination

  32. Mutations in Programs • Single parental program is probabilistically selected from the population based on fitness. • Mutation point randomly chosen. • the subtree rooted at that point is deleted, and • a new subtree is grown there using the same random growth process that was used to generate the initial population. • Asexual operations (mutation) are typically performed sparingly: • with a low probability of mutations, • probabilistically selected from the population based on fitness.

  33. Crossovers in Programs

  34. Crossovers in Programs • Two parental programs are selected from the population based on fitness. • A crossover point is randomly chosen in the first and second parent. • The first parent is called receiving • The second parent is called contributing • The subtree rooted at the crossover point of the first parent is deleted • It is replaced by the subtree from the second parent. • Crossoveris the predominant operation in genetic programming (and genetic algorithm) research • It is performed with a high probability (say, 85% to 90%).

  35. Applications of GP in robotics • Wall-following robot – Koza • Behaviors of subsumption architecture of Brooks. Evolved a new behavior. • Box-moving robot – Mahadevan • Evolving behavior primitives and arbitrators • for subsumption architecture • Motion planning for hexapod – Fukuda, Hoshino, Levy PSU. • Evolving communication agents Iba, Ueda. • Mobile robot motion control – Walker. • for object tracking • Soccer • Car racing Population sizes from 100 to 2000

  36. Subset of LISP for Genetic Programming

  37. This is a very very small subset of Lisp LISP = Famous first language of Artificial Intelligence and Robotics

  38. More functions • Atom, list, cons, car, cdr, numberp, arithmetic, relations. Cond. • Copying example

  39. A very important concept – Lisp does not distinguish data and programs

  40. Programs in Lisp are trees that are evaluated (calculated) Tree-reduction semantics

  41. Lisp allows to define special languages in itself

  42. Robot-Lisp cont • This subset of Lisp was defined for a mobile robot • You can define similar subsets for a humanoid robot, robot hand, robot head or robot theatre

  43. As an exercise, you can think about behaviors of all Braitenberg Vehicles described by such programs

  44. You can define much more sophisticated mutations that are based on constraints and in general on your knowledge and good guesses (heuristics)

  45. You can define your own languages in Lisp You can write your own Lisp-like language interpreter in C++ Many on Web

  46. EyeSim simulator allows to simulate robots, environments and learning strategies together, with no real robot In our project with teens the feedback is from humans who evaluate the robot theatre performance (subjective) In our previous project with hexapod the feedback was from real measurement in environment (objective) Evolution here takes feedback from simulated environment (simulated)

  47. Evolution principles are the same for all evolutionary algorithms. • Each individual (Lisp program) is executed on the EyeSim simulator for a limited number of program steps. • The program performance is rated continually or when finished.

  48. Sample Problem: Ball Tracking

  49. Sample Problem: Ball Tracking GOALS • Find ball in environment • Drive towards it • Stop when close to ball A single robot is placed at a random position and orientation in a rectangular driving area closed by walls. A colored ball is also placed at a random position. Using its camera, the robot has to detect the ball, drive towards it, and stop close to it. The robot camera is positioned at an angle so the robot can see the wall ahead from any position in the field. However, the ball is not always visible. • Similar other tasks that we solved: • Collect cans • Shoot goal in soccer • Robot sumo • Robot fencing

More Related