Genetic Programming.

Slides:



Advertisements
Similar presentations
Genetic Programming Dan Kiely Ran Shoham Brent Heigold
Advertisements

Genetic Algorithms Genetic Programming Ata Kaban School of Computer Science University of Birmingham 2003.
Tuesday, May 14 Genetic Algorithms Handouts: Lecture Notes Question: when should there be an additional review session?
Biologically Inspired AI (mostly GAs). Some Examples of Biologically Inspired Computation Neural networks Evolutionary computation (e.g., genetic algorithms)
Institute of Intelligent Power Electronics – IPE Page1 Introduction to Basics of Genetic Algorithms Docent Xiao-Zhi Gao Department of Electrical Engineering.
Content Based Image Clustering and Image Retrieval Using Multiple Instance Learning Using Multiple Instance Learning Xin Chen Advisor: Chengcui Zhang Department.
1 Lecture 8: Genetic Algorithms Contents : Miming nature The steps of the algorithm –Coosing parents –Reproduction –Mutation Deeper in GA –Stochastic Universal.
Evolutionary Design By: Dianna Fox and Dan Morris.
Genetic Algorithm and Genetic Programming. Crossovers in Nature Two parental chromosomes exchange part of their genetic information to create new hybrid.
Doug Downey, adapted from Bryan Pardo, Machine Learning EECS 349 Machine Learning Genetic Programming.
Intro to AI Genetic Algorithm Ruth Bergman Fall 2002.
CS 447 Advanced Topics in Artificial Intelligence Fall 2002.
Genetic Programming. Agenda What is Genetic Programming? Background/History. Why Genetic Programming? How Genetic Principles are Applied. Examples of.
Khaled Rasheed Computer Science Dept. University of Georgia
Genetic Programming Dinesh Dharme Prateek Srivastav Pankhil Chheda
Genetic Algorithms Overview Genetic Algorithms: a gentle introduction –What are GAs –How do they work/ Why? –Critical issues Use in Data Mining –GAs.
Genetic Programming.
Slides are based on Negnevitsky, Pearson Education, Lecture 10 Evolutionary Computation: Evolution strategies and genetic programming n Evolution.
Prepared by Barış GÖKÇE 1.  Search Methods  Evolutionary Algorithms (EA)  Characteristics of EAs  Genetic Programming (GP)  Evolutionary Programming.
Genetic Algorithm.
Genetic Algorithms and Ant Colony Optimisation
Evolutionary Intelligence
Chapter 11: Artificial Intelligence
Slides are based on Negnevitsky, Pearson Education, Lecture 12 Hybrid intelligent systems: Evolutionary neural networks and fuzzy evolutionary systems.
SOFT COMPUTING (Optimization Techniques using GA) Dr. N.Uma Maheswari Professor/CSE PSNA CET.
Evolution Strategies Evolutionary Programming Genetic Programming Michael J. Watts
© Negnevitsky, Pearson Education, Lecture 10 Evolutionary Computation: Evolution strategies and genetic programming Evolution strategies Evolution.
Intro. ANN & Fuzzy Systems Lecture 36 GENETIC ALGORITHM (1)
Study on Genetic Network Programming (GNP) with Learning and Evolution Hirasawa laboratory, Artificial Intelligence section Information architecture field.
Lecture 8: 24/5/1435 Genetic Algorithms Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
Zorica Stanimirović Faculty of Mathematics, University of Belgrade
What is Genetic Programming? Genetic programming is a model of programming which uses the ideas (and some of the terminology) of biological evolution to.
Introduction to Evolutionary Algorithms Session 4 Jim Smith University of the West of England, UK May/June 2012.
Evolving Virtual Creatures & Evolving 3D Morphology and Behavior by Competition Papers by Karl Sims Presented by Sarah Waziruddin.
Derivative Free Optimization G.Anuradha. Contents Genetic Algorithm Simulated Annealing Random search method Downhill simplex method.
G ENETIC P ROGRAMMING Ranga Rodrigo March 17,
Artificial Intelligence Chapter 4. Machine Evolution.
Exact and heuristics algorithms
1 Genetic Algorithms and Ant Colony Optimisation.
Genetic Algorithms Przemyslaw Pawluk CSE 6111 Advanced Algorithm Design and Analysis
Chapter 9 Genetic Algorithms.  Based upon biological evolution  Generate successor hypothesis based upon repeated mutations  Acts as a randomized parallel.
Genetic Programming A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing Chapter 6.
Genetic Algorithms. The Basic Genetic Algorithm 1.[Start] Generate random population of n chromosomes (suitable solutions for the problem) 2.[Fitness]
CITS7212: Computational Intelligence An Overview of Core CI Technologies Lyndon While.
An Introduction to Genetic Algorithms Lecture 2 November, 2010 Ivan Garibay
Genetic Algorithm Dr. Md. Al-amin Bhuiyan Professor, Dept. of CSE Jahangirnagar University.
Genetic Programming Using Simulated Natural Selection to Automatically Write Programs.
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal Evolutionary Computation.
Genetic Algorithms An Evolutionary Approach to Problem Solving.
Genetic Algorithm. Outline Motivation Genetic algorithms An illustrative example Hypothesis space search.
 Presented By: Abdul Aziz Ghazi  Roll No:  Presented to: Sir Harris.
March 1, 2016Introduction to Artificial Intelligence Lecture 11: Machine Evolution 1 Let’s look at… Machine Evolution.
Presented By: Farid, Alidoust Vahid, Akbari 18 th May IAUT University – Faculty.
 Negnevitsky, Pearson Education, Lecture 12 Hybrid intelligent systems: Evolutionary neural networks and fuzzy evolutionary systems n Introduction.
Genetic Programming.
Chapter 14 Genetic Algorithms.
Selected Topics in CI I Genetic Programming Dr. Widodo Budiharto 2014.
Evolution Strategies Evolutionary Programming
Evolution strategies and genetic programming
GENETIC PROGRAMMING BBB4003.
Genetic Algorithm and Genetic Programming
Artificial Intelligence Chapter 4. Machine Evolution
Introduction to Artificial Intelligence Lecture 11: Machine Evolution
Artificial Intelligence Chapter 4. Machine Evolution
Genetic Programming Chapter 6.
Genetic Programming Chapter 6.
Genetic Programming Chapter 6.
Genetic Algorithm Soft Computing: use of inexact t solution to compute hard task problems. Soft computing tolerant of imprecision, uncertainty, partial.
GENETIC PROGRAMMING BBB4003.
Beyond Classical Search
Presentation transcript:

Genetic Programming

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.

Genetic Algorithms Fitness function Selection scheme Genetic operators Crossover Mutation

Crossover and mutation.

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

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

What is Genetic Programming(GP)? ROBOTICS Artificial Intelligence Machine learning evolutionary GP EP GA ES Artificial Intelligence

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

Evolutionary Strategies 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 stagnation at local optima

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

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 (ie Genotype = 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.

General Architecture of Evolutionary Algorithms

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

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.

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.

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

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

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

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

“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.

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…

Fitness Test Criteria Time complexity a good criteria. i.e. n2 vs. nlogn. Accuracy - Values of variables. Combinations of criteria may also be tested.

Mutations in Nature Ultimate source of genetic variation. 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

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

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, probabilistically selected from the population based on fitness.

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.

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. Crossover is the predominant operation in genetic programming (and genetic algorithm) research It is performed with a high probability (say, 85% to 90%).

Applications of GP in robotics Wall-following robot – Koza Behaviors of subsumption architecture of Brooks. Evolved a new behavior. Box-moving robot – Mahadevon 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

This is a very very small subset of Lisp

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

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

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

Lisp allows to define special languages in itself

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

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

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

EyeSim simulator allows to simulate robots, environments and learning strategies together with no real robot Evolution here takes feedback from simulated environment (simulated) 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 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.

Sample Problem: Ball Tracking 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. Find ball in environment Drive towards it Stop when close to ball Similar other tasks that we solved: Collect cans Shoot goal in soccer Robot sumo Robot fencing

Idea for solving In the loop, grab an image and analyze it as follows: Convert the image from RGB to HSV. Use the histogram ball detection routine from section 8.6 of the book (this returns a ball position in the range [0..79] (left.. Right) or no ball and a ball size in pixels [0..60]) If the ball height is 20 pixels or more, then stop and terminate (the robot is close enough to the ball) Otherwise If no ball is detected or the ball position is less than 20, turn slowly left. If the ball position is between 20 and 40, drive slowly straight If the ball position is greater than 40, turn slowly right.

ColSearch returns the x-position of the ball or -1 if not detected and the ball height in pixels. The statement VWDriveWait following either VWDriveTurn or a VWDriveStraight command suspends execution driving or rotation of the requested distance or angle has finished.

The evolution can start from random data or from good hand-coded solutions from humans Bear in mind that obj_size and obj_pose are in fact calls to the image processing subroutine.

Evolution of tracking behavior Koza suggests the following steps for setting up a genetic programming system: 1. Establish an objective. 2. Identify the terminals and functions used in the inductive programs 3. Establish the selection scheme and its evolutionary operations 4. Finalize the number of fitness cases 5. Determine the fitness function and hence the range of raw fitness values 6. Establish the generation gap G, and the population M 7. Finalize all control parameters. 8. Execute the Genetic Paradigm.

EyeSim simulator allows to simulate robots, environments and learning strategies together with no real robot Evolution here takes feedback from simulated environment (simulated) 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)

Summary on GP Field of study in Machine Learning. Created by John Koza in 1992. Save time while creating better programs. Based on the principles of genetics. Symbolic Regression/Circuit Design.

Example of using Genetic Programming in Robotics Use of simulation

Robot’s view and driving path in EyeSim simulator Robot trajectory

You want to maximize this fitness function

Fitness grows in next populations (in general) Highest fitness

What are the evolved trajectories of the robot to meet the ball? The best trajectory

Use of improved GP Use of parallel processing Use of FPGA and evolvable hardware Use of quantum computers in future.

Behavior-Based Systems Rodney Brooks, 1986 Ronald Arkin, 1998 Instead of single, monolithic program, use a number of behaviors ( parallel processes) Improve changeability Utililize emergence Each behavior has access to all sensors and actuators Problem: behavior selection There are now many variants of behavior-based robots. Braitenberg is just one of them.

Good old-fashioned hierarchical software architecture for a robot

Modern behavioral software architecture for a robot

Behavior Selection Clearly, we cannot have two different behaviors in control of actuators (e.g. obstacle-avoidance wants to drive left, ball-detection wants to drive right) Solution 1: Always select one behavior as active Solution 2: Add actuator output of all behaviors, multiplied with certain coefficients

Behavior Selection Remaining problem: Solution: ?? How to determine which behavior to select or which coefficients to use Solution: ?? How about using GA to evolve a solution!

Behavior Selection Trial result Single chromosome Parameters Evolution of controller parameters Direct inputs camera Ball detection Processed sensor input Schema weighting Move to ball Avoid obstacles Schemas using direct and processed inputs schemas Trial result Actuator output Single chromosome

Many tools of this type are created In this class the projects are about animatronix editor and state based editor Another possibility is to use Artificial Neural Network

This slide shows hierarchical editor for subsumption-type architecture

Sample Problem: Ball Tracking Find ball in environment Drive towards it [Stop when close to ball] Behavior selection: Use NN Evolve NN weights using GA

Behavior Selection with NN and GA Fitness function: fitness = initDist - b_distance(); if (fitness < 0.0) fitness = 0.0;

Both approaches can provide increase in Fitness function Both approaches can provide increase in Fitness function. The problem is how good?

Trajectories found by behavioral approaches

AI in robotics (first summary) Neural Networks Learning requires complete test set with correct results Genetic Algorithms Evolving solutions based on fitness function can be used in real robot or in simulation (often easier/faster) Genetic Programming Requires algorithm coding/interpretation (e.g. Lisp) Behavior-Based Systems Combining parallel processing approach with intelligent selection scheme

Other areas - Examples of Genetic Programs 1. Symbolic Regression - the process of discovering: the functional form of a target function and all of its necessary coefficients, or at least an approximation to these. 2. Analog circuit design Embryo circuit is an initial circuit which is modified to create a new circuit according to functionality criteria.

Genetic Programming in the Future Speculative. Only been around for 10 years. Is very successful. Discovery of new algorithms in existing projects. Can be combined with constructive induction, LISP-based systems, evolutionary hardware, neural networks, fuzzy logic, quantum logic and many other ideas and methods. Mr. Roboto

Oh yeah. Hm hm yeah yeah hm. End of Show Hey Butthead. That kicked ass. Oh yeah. Hm hm yeah yeah hm. It sucked. Shut up Buttmunch. That sucked.

Sources Braunl Dan Kiely Ran Shoham Brent Heigold CPSC 533, Artificial Intelligence