Genetic Programming. Genetic Programming. Genetic Programming. Genetic Programming. Genetic Programming. Genetic Programming

Similar documents
Evolving caching algorithms in C by genetic programming

Distinguishing genotype and phenotype in genetic programming

Genetic Programming. Modern optimization methods 1

Evolutionary Computation. Chao Lan

Mutations for Permutations

3DUDOOHO*UDPPDWLFDO(YROXWLRQ

Previous Lecture Genetic Programming

made up from the BNF denition. However, GPK has been criticised [Paterson 97] for the diculty associated with generating the rst generation - consider

Genetic Programming Part 1

Santa Fe Trail Problem Solution Using Grammatical Evolution

Genetic Algorithms. Kang Zheng Karl Schober

Introduction to Genetic Algorithms. Genetic Algorithms

Genetic Algorithms Variations and Implementation Issues

Genetic Programming Prof. Thomas Bäck Nat Evur ol al ut ic o om nar put y Aling go rg it roup hms Genetic Programming 1

Genetic Programming: A study on Computer Language

AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENETIC ALGORITHMS

Genetic programming. Lecture Genetic Programming. LISP as a GP language. LISP structure. S-expressions

Genetic Algorithms. PHY 604: Computational Methods in Physics and Astrophysics II

Optimization of the Throughput of Computer Network Based on Parallel EA

Where We Are. CMSC 330: Organization of Programming Languages. This Lecture. Programming Languages. Motivation for Grammars

CMSC 330: Organization of Programming Languages. Architecture of Compilers, Interpreters

Introduction to Genetic Algorithms. Based on Chapter 10 of Marsland Chapter 9 of Mitchell

A Comparative Study of Linear Encoding in Genetic Programming

Hierarchical Crossover in Genetic Algorithms

Architecture of Compilers, Interpreters. CMSC 330: Organization of Programming Languages. Front End Scanner and Parser. Implementing the Front End

Genetic Algorithms. Genetic Algorithms

Genetic Algorithms and Genetic Programming Lecture 9

Neural Network Weight Selection Using Genetic Algorithms

Evolutionary Art with Cartesian Genetic Programming

A Comparison of Several Linear Genetic Programming Techniques

Syntax. In Text: Chapter 3

Computational Intelligence

CMSC 330: Organization of Programming Languages. Context Free Grammars

Genetic Programming. Czech Institute of Informatics, Robotics and Cybernetics CTU Prague.

Introduction to Design Optimization: Search Methods

Intermediate Code Generation

Genetic Programming. and its use for learning Concepts in Description Logics

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages. Context Free Grammars

Automated Program Repair through the Evolution of Assembly Code

MDL-based Genetic Programming for Object Detection

On the Locality of Grammatical Evolution

Artificial Intelligence Application (Genetic Algorithm)

Robust Gene Expression Programming

CMSC 330: Organization of Programming Languages

Software Vulnerability

Outline. Motivation. Introduction of GAs. Genetic Algorithm 9/7/2017. Motivation Genetic algorithms An illustrative example Hypothesis space search

CMSC 330: Organization of Programming Languages

Evolving Hierarchical and Recursive Teleo-reactive Programs through Genetic Programming

Evolutionary Algorithms Evolution of Symbolic Structures

Escaping Local Optima: Genetic Algorithm

Heuristic Optimisation

An improved representation for evolving programs

Multi Expression Programming. Mihai Oltean

CHAPTER 5 ENERGY MANAGEMENT USING FUZZY GENETIC APPROACH IN WSN

Genetic Programming for Julia: fast performance and parallel island model implementation

GENETIC ALGORITHM with Hands-On exercise

Wednesday, September 9, 15. Parsers

Parsers. What is a parser. Languages. Agenda. Terminology. Languages. A parser has two jobs:

Structure of a compiler. More detailed overview of compiler front end. Today we ll take a quick look at typical parts of a compiler.

Lecture 6: Genetic Algorithm. An Introduction to Meta-Heuristics, Produced by Qiangfu Zhao (Since 2012), All rights reserved

A programming language requires two major definitions A simple one pass compiler

An empirical study of the efficiency of learning boolean functions using a Cartesian Genetic Programming approach

Encoding Techniques in Genetic Algorithms

JEvolution: Evolutionary Algorithms in Java

Planning and Search. Genetic algorithms. Genetic algorithms 1

A Genetic Algorithm Implementation

Genetic Programming of Autonomous Agents. Functional Requirements List and Performance Specifi cations. Scott O'Dell

"Good" vs. "Bad" Expressions. ; interp-expr FAE... -> FAE-Value

A Memetic Genetic Program for Knowledge Discovery

The calculator problem and the evolutionary synthesis of arbitrary software

Constructing an Optimisation Phase Using Grammatical Evolution. Brad Alexander and Michael Gratton

Programming Language Definition. Regular Expressions

A More Stable Approach To LISP Tree GP

Recursive Data Structures and Grammars

a. Determine the EPS, FIRST and FOLLOWs set for this grammar.

Chapter 3. Describing Syntax and Semantics

CONCEPT FORMATION AND DECISION TREE INDUCTION USING THE GENETIC PROGRAMMING PARADIGM

Evolutionary design for the behaviour of cellular automaton-based complex systems

CMPS Programming Languages. Dr. Chengwei Lei CEECS California State University, Bakersfield

CSCI 3155: Principles of Programming Languages Exam preparation #1 2007

CHAPTER 4 GENETIC ALGORITHM

Syntax Analysis Part I

Chapter 9: Genetic Algorithms

COP4020 Programming Languages. Syntax Prof. Robert van Engelen

Introduction to Optimization

Parsers. Xiaokang Qiu Purdue University. August 31, 2018 ECE 468

Evolving Teleo-Reactive Programs for Block Stacking using Indexicals through Genetic Programming

Genetic Algorithms. Chapter 3

Evolutionary Algorithms. CS Evolutionary Algorithms 1

Genetic Algorithms and Genetic Programming. Lecture 9: (23/10/09)

Automatic Generation of Prime Factorization Algorithms Using Genetic Programming

Introduction to Design Optimization: Search Methods

Design Automation MAE 2250

Earlier edition Dragon book has been revised. Course Outline Contact Room 124, tel , rvvliet(at)liacs(dot)nl

Evolutionary Computation Part 2

Genetically Improved BarraCUDA

Introduction to Genetic Algorithms

Genetic Algorithms for Vision and Pattern Recognition

Machine Evolution. Machine Evolution. Let s look at. Machine Evolution. Machine Evolution. Machine Evolution. Machine Evolution

Transcription:

What is it? Genetic programming (GP) is an automated method for creating a working computer program from a high-level problem statement of a problem. Genetic programming starts from a highlevel statement of what needs to be done and automatically creates a computer program to solve the problem. 1 2 John Koza, 1992 : On the Programming of Computers by Means of Natural Selection www.genetic-programming.com 3 In genetic programming: 4 Problem -- involves not finding a solution, but instead creating a program that can find the best solution. Phenotype (solution) is a computer program Search space is the set of all possible computer programs. 5 In Koza s original work LISP was used as the programming language Parse trees were used as the genotype. Straight-forward genetic mapping Functional program --> parse tree. 6 1

LISP and parse trees (defun o() (setf A 1.52) (sqtr (* A (* A A )))) A sqrt * * GPs fit well within the EA framework Important distinction: Genotype = tree Phenotype = LISP program A A Mitchell 7 8 Defining your problem Define your genotype Identify your phenotype For programs to be be evolved, must define: Terminal Set Leaves of the parse tree Correspond to program inputs Function Set Interior nodes of parse tree Set of functions allowable in program Should be chosen with relation to problem to be solved. Can have side effects. 9 10 Defining your problem Sufficiency and Closure Sufficiency terminals + functions must be able to solve the problem at hand Choose your terminal and function set wisely Closure Functions should be able to accept as argument any value returned by other functions Universal return type. Define your genotype -- parse trees Identify your phenotype -- LISP program 11 12 2

GPs: Crossover and Mutation GPs: Crossover and Mutation Crossover Choose random sub-tree from each parent Swap them in resultant children Mutation Replace randomly chosen sub-tree with randomly generated tree. Before crossover After crossover crossover mutation Before mutation After mutation Can result in increasing / decreasing the size of the genome. 13 Note that operation maintain valid individuals. 14 GPs and crossover Define your genotype -- parse trees Identify your phenotype -- LISP program 15 16 Fitness Evaluate the effectiveness of the program to solve the problem Two stage fitness: Run resultant program Compare to correct / desired results Define your genotype -- parse trees Identify your phenotype -- LISP program 17 18 3

In Koza s original work: 10% of individuals will move to next generation Probability based on Fitness 90% formed by crossover Parent chosen probabilistically based on fitness Koza does not use mutation. Define your genotype -- parse trees Identify your phenotype -- LISP program 19 20 Initializing population Randomly creating programs. Must assure that trees match valid programs. Number of function arguments must match. Usually a limit is set on tree depth of generated program. Questions so far Trivial example From Mitchell Program to compute P, the orbital period of a planet. Parameters A = average distance from the sun. Known solution: P 2 = ca 3 c = constant. 21 22 Trivial example Trivial example Terminal set: A = average distance from the sun Function set: Typical arithmetic operations: +, -, *, /, sqrt Closure -- Note that all take float and return float 23 24 4

Trivial example Sample solutions Trivial example Fitness: 25 26 More interesting Example Other GP variants Block stacking problem Koza 1992 as described by Mitchell Given: Set of blocks that can either be On a stack On a table. Strongly typed GP Gets around the closure idea Function arguments are typed Individual generation and genetic operators must respect the types. Goal: Find a program that will place the blocks on the stack in the correct order. 27 28 Building Block Example Factoids about More elaborate scheme to solve this: Using Strongly Typed GPs Found in [Kochenderfer] Questions? From Koza s Web site There are now 36 instances where genetic programming has produced a human-competitive result. 15 instances where GP has created an entity that either infringes or duplicates the functionality of a previous patent 6 instances where genetic programming has done the same with respect to a 21st-centry invention 2 instances where genetic programming has created a patentable new invention. 29 30 5

Factoids about GPs themselves were patented by Koza: Koza, John R. Non-Linear Genetic Algorithms for Solving Problems. US Patent 4,935,877. Issued June 19, 1990. Australian Patent 611,350. Issued September 21, 1991. Canadian Patent 1,311,561. Issued December 15, 1992. German patent 3916328.8-53. Issued June 18, 1997. In Koza s original work LISP was used as the programming language Parse trees were used as the genotype. Straight-forward genetic mapping Functional program --> parse tree. Not the only way to do genetic programming. 31 32 In genetic programming: Problem -- involves not finding a solution, but instead creating a program that can find the best solution. Phenotype (solution) is a computer program Search space is the set of all possible computer programs. Genotype need not be a parse tree! GPs as GAs GADS [Paterson, Livesey] Phenotype = program Genotype = n-tuple (array). 33 34 Languages as grammars Phenotype Representation Grammars for programming languages <stmt> <for-stmt> <if-stmt> <stmt> { <stmt> <stmt> } ε <if-stmt> if ( <expr> ) then <stmt> <for-stmt> for ( <expr>; <expr>; <expr>) <stmt> Phenotype is a program in a given language Language is defined by a grammar in BNF. Each production in the grammar is uniquely numbered. lhs rhs <sexpr> (GT <sexpr> <sexpr>) 35 36 6

Phenotype Representation Genotype representation A valid program can be described by a sequence of applications of grammar rules. Genotype = tuple or array representing this sequence. Let s try: (GT (* -1 X) (* V (ABS V) ) ) Can use standard GA operators for tuples for crossover and mutation. 37 38 Genetic Mapping Genetic Repairs Required: Inapplicable productions. Assume after a number of production applications (as defined by a genome) the generated program is: Genetic Mapping Genetic Repairs Required: Inapplicable productions. Genetic repair: skip the problematic gene and progress to the first gene that has an appropriate lhs. (GT <sexpr> <numeral>) What if the the production of the next gene does NOT have a lhs of <sexpr> or <numeral>? 39 40 Genetic Mapping Genetic Repairs Required: Residual non-terminals What if after all productions associated to all genes have been applied and there are still non-terminals in the program? Genetic Mapping Genetic Repairs Required: Residual non-terminals Reject this individual or Have each non-terminal have a default terminal value and use this default. 41 42 7

Fixed length vs variable length Genotype Can use either For fixed length, stop after all nonterminals have been exhaused and replaced. Paper used fixed length chromosomes of length 50 and 200. Findings Certainly a viable approach Very grammar specific Even different grammars for same language. No need to use LISP. Better than traditional GPs? Jury is still out. 43 44 Paterson Paper Take home messages: Distinction between genotype and phenotype GPs don t have to use parse trees as phenotype. GPs need not only use LISP. Creative genetic mapping and repair Questions? 45 8