strongly formed genetic programming 06/19/2013. agenda strongly formed genetic programming (sfgp)...

14
Strongly Formed Genetic Programming 06/19/2013

Upload: patrick-paul

Post on 14-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

Strongly Formed Genetic Programming06/19/2013

Page 2: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

Agenda• Strongly formed genetic programming (SFGP)• Where it fits• Current progress• Next steps

Page 3: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

SFGP• GP for evolving programs [Castle2012]• Uses basic programming constructs to generate code for a given

problem

• Extends previous work in Strongly Typed Genetic Programming [Montana1995]• Nodes specify data-type constraints on inputs • Removes need for closure

• No restraint on tree structure as typical grammars• Data-type constraints provide structure

• No control structure found in imperative programming constructs

Page 4: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

SFGP• Extends STGP by imposing extra node restrictions• Node must define:

• Data-type (integer, float, etc.)

• Node-type• Allowable child terminals or non-terminals

• For example, Assignment node must have a first child that is both an integer and a variable

• Must be satisfied throughout evolutionary process

Page 5: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

SFGP• Extends STGP by imposing extra node restrictions• Node must define:

• Data-type (integer, float, etc.)

• Node-type• Allowable child terminals or non-terminals

• For example, Assignment node must have a first child that is an integer and a variable

• Must be satisfied throughout evolutionary process

Assignment

Integer Variable

Integer Expression

int var = 5;

Page 6: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

SFGP• Extends STGP by imposing extra node restrictions• Node must define:

• Data-type (integer, float, etc.)

• Node-type• Allowable child terminals or non-terminals

• For example, Assignment node must have a first child that is an integer and a variable

• Must be satisfied throughout evolutionary process

For Loop

Integer Variable Code BlockInteger

Expression

for (int i = 0; i < 20; ++i){ Code Block}

Iterator Upper Bound

Page 7: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

SFGP Types• Top-level• Subroutine• CodeBlock

• Statement• Loop• ForLoop• ForEachLoop• IfStatement• Assignment

• Expression• Add• Subtract• Multiply• And• Or

Not• Literal• Variable

Page 8: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

Where it Fits• Tree halves• One half provides role transformations• One half provides code generation

• Using SFGP, we will generate the code for the composition strategies• Advantage of SFGP is that we can output into any language

• Also high level representations of nodes, as we had before

• Initial approach had some roadblocks with post-processing for generating quality code• Allow algorithm to take control

Page 9: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

Where it Fits

WRAPPER

Code Generation

Role Transformations

Page 10: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

Current Progress• Implementing vanilla SFGP

• Creating new primitives and functionality in Puppy• Running into some issues

• At 12:30am, I realized…• STGP is already a part of OpenBEAGLE proper

Page 11: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

Next Steps• Migrate to OpenBEAGLE and get sample programs up and

running• Customize for our needs

• Migrate and merge role transformations

Page 12: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

Sample Output from Puppy• Best individual at generation 50 is: • (CODEBLOCK (OR (CODEBLOCK X X (VARIABLE X)) (ASSIGNMENT X (SUBROUTINE X

X))) (LITERAL (LOOP (MULTIPLY X X) (ASSIGNMENT X X))) (IFSTATEMENT X (ADD X X)))• ===================• CODEBLOCK• VARIABLE• OR• ASSIGNMENT• SUBROUTINE• CODEBLOCK• MULTIPLY• LOOP• ASSIGNMENT• LITERAL• IFSTATEMENT• ADD• ===================

Page 13: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

Frameworks• SFGP – EpochX• Java Framework• http://www.epochx.org/

• OpenBEAGLE• Provides STGP support (must be extended for SFGP)

• SPAMBASE example uses STGP• Stable release (3.0.3) has a run-time error• Alpha build runs properly (4.0.0 – Alpha 2)• http://code.google.com/p/beagle/downloads/list

Page 14: Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps

New References• [Castle2012]• T. Castle and C. G. Johnson. Evolving high-level imperative

program trees with strongly formed genetic programming. In Proceedings of the 15th European Conference on Genetic Programming, EuroGP 2012, volume 7244 of LNCS, pages 1–12. Springer, Apr. 2012.

• [Montana1995]• Montana, D.J.: Strongly typed genetic programming. Evolutionary

Computation 3 (1995) 199-230