CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

39
CAGE: A Tool for CAGE: A Tool for Parallel Genetic Parallel Genetic Programming Programming Applications Applications Gianluigi Folino Gianluigi Folino

Transcript of CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

Page 1: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

CAGE: A Tool for Parallel CAGE: A Tool for Parallel Genetic Programming Genetic Programming ApplicationsApplications

Gianluigi FolinoGianluigi Folino

Page 2: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

2

OutlineOutline IntroductionIntroduction

What is GP How GP works Interesting results

Parallel GPParallel GP Parallel Model for Evolutionary Algorithms Implementation of CAGE (cellular model) Convergence analysis Scalability Analysis

Future Works (some ideas)Future Works (some ideas) Data Mining and Classification Grid Computing Information Retrieval

Page 3: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

3

Problem Solving and GPProblem Solving and GP Genetic Programming is a general concept to solve Genetic Programming is a general concept to solve

problems.problems.

Heuristic to find a global optimum in a search space.Heuristic to find a global optimum in a search space.

Weak method including little knowledge about the Weak method including little knowledge about the problem to solve.problem to solve.

Mimic the process of natural evolution for the Mimic the process of natural evolution for the emergence of complex structure (solutions).emergence of complex structure (solutions).

In a population of computer programs (candidate In a population of computer programs (candidate solutions), only best fit programs survive evolution.solutions), only best fit programs survive evolution.

Page 4: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

4

Individual representation and search spaceIndividual representation and search space

The user choose the functions and the terminals The user choose the functions and the terminals necessarynecessary to solve to solve a problem.a problem.

The search space is composed from all the possible programs The search space is composed from all the possible programs generated recursively from the functions and the terminals chosen.generated recursively from the functions and the terminals chosen.

An computer program (individual) is represented as a parse tree.An computer program (individual) is represented as a parse tree.

If (time > 10)If (time > 10)

ris = 1 + 2 + 3;ris = 1 + 2 + 3;

elseelse

ris = 1 + 2 + 4;ris = 1 + 2 + 4;

Page 5: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

5

How GP works.How GP works.Genetic programming, uses four steps to solve problems:Genetic programming, uses four steps to solve problems:

I.I. Generate an initial population of random compositions of the Generate an initial population of random compositions of the functions and terminals of the problem (computer programs).functions and terminals of the problem (computer programs).

II.II. Execute each program in the population and assign it a fitness Execute each program in the population and assign it a fitness value according to how well it solves the problem.value according to how well it solves the problem.

III.III. Create a new population of computer programs by applying Create a new population of computer programs by applying genetic operators (mutation, crossover, etc.) to some selected genetic operators (mutation, crossover, etc.) to some selected tree (best fit trees are selected most likely)tree (best fit trees are selected most likely)

IV.IV. The best computer program that appeared in any generation, the The best computer program that appeared in any generation, the best-so-far solution, is designated as the result of genetic best-so-far solution, is designated as the result of genetic programming.programming.

Page 6: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

6

Flow ChartFlow Chartof GPof GP

Page 7: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

7

Crossover exampleCrossover example

X + Y + 3 x / 2 + 3 X + Y + 3 x / 2 + 3 y + 1 + x / 2y + 1 + x / 2 y + 1 + x + yy + 1 + x + y

Page 8: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

8

Mutation exampleMutation example

X + Y + 3 X + Y + 3 X + Y + Y * (X / 2) X + Y + Y * (X / 2)

Page 9: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

9

Preparatory stepsPreparatory steps Determine the representation scheme:Determine the representation scheme:

– set of terminals (ex: {x, y, z})

– set of functions (ex: {=, +, -, *, /})

Determine the fitness measure.Determine the fitness measure.

Determine the parametersDetermine the parameters– Population size, number of generations

– Number of atoms in program

– Probability of crossover, mutation, reproduction

Determine the criterion for terminating a run (max number of Determine the criterion for terminating a run (max number of generations or exact solution).generations or exact solution).

Page 10: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

10

GP Best ResultsGP Best Results

Creation of four different algorithms for the transmembrane segment identification problem for proteins.

Automatic decomposition of the problem of synthesizing a crossover filter.

Synthesis of 60 and 96 decibel amplifiers.

Creation of soccer-playing program that ranked in the middle of the field of 34 human-written programs in the Robo Cup 1998 competition.

Page 11: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

11

GP Best Results and atypical fitness GP Best Results and atypical fitness evaluationevaluation

Art and GPArt and GP Board Games and GPBoard Games and GP

Page 12: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

12

Why Parallel GPWhy Parallel GP The search of solutions is implicitly parallelThe search of solutions is implicitly parallel

Hard problems require large populationsHard problems require large populations

Time requirements and Memory Requirements Time requirements and Memory Requirements for GP (scalability)for GP (scalability)

Locality in the selection operator could help Locality in the selection operator could help mantaining diversity (convergence)mantaining diversity (convergence)

Page 13: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

13

Models of Parallel GP (Global)Models of Parallel GP (Global)

MasterMaster

SlaveSlave SlaveSlave SlaveSlaveSlaveSlave

No distribution of populationNo distribution of populationMaster: select, cross, mutateMaster: select, cross, mutateSlaves: evaluate fitnessSlaves: evaluate fitnessConvergence is the same of sequential GPConvergence is the same of sequential GP

Page 14: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

14

Models of Parallel GP (Island and Cellular)Models of Parallel GP (Island and Cellular)

Island ModelIsland Model Cellular ModelCellular Model

Page 15: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

15

CAGECAGECAGE (CellulAr GEnetic programming tool) is a parallel tool for the development of genetic programs (GP).

It is implemented using the cellular model on a general purpose distributed memory parallel computer.

CAGE is written in C, using the MPI Libraries for the communications between the processors.

It can also run on a PC with Linux operating system.

Page 16: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

16

CAGE ImplementationCAGE Implementation

Processor0

Processor1

Processor2

single individual

The population is arranged in a two-dimensional grid, where each pointThe population is arranged in a two-dimensional grid, where each point

represents a program tree.represents a program tree.

CAGE uses a one-dimensional domain decomposition along the x direction.CAGE uses a one-dimensional domain decomposition along the x direction.

Page 17: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

17

CAGE ImplementationCAGE Implementation

For each element in the grid:•Mutation and unary operators are applied to the current tree

•Crossover choices as second parent, the best tree among the neighbours (Moore neighbourhood).

•It is applied a policy of replacement.

•The chosen individual is put in the new population in the same position of the old one.

We have three replacement policies (applied to the result of crossover):

Greedy

Direct

Probabilistic (SA)

Page 18: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

18

Convergence analysisConvergence analysis

Maximum number of generations 100Probability of crossover 0.8Probability of mutation 0.1Probability of reproduction 0.1Generative method for initial pop. RampedMax depth for a new tree 6Max depth for a tree after crossover 8Max depth of a tree for mutation 4Parsimony factor 0.0

CAGE was tested on some standard problems: Symbolic Regression, Discovery of Trigonometric Identities, Symbolic Integration, Even 5-Parity, Artificial Ant and Royal Tree.

We averaged the tests over 20 runs and used a population of 3200 individual (1600 forSymbolic Regression and Integration).

Parameter used in the experiments (selection method was Greedy for CAGE andfitness proportionate for canonical).

Page 19: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

19

Terminal Symbols XFunctions +, -, *, %, sin, cos, exp, rlog

Symbolic regression consists in searching for a non trivial mathematical expression that, given a set of value xi for the independent variable, it always assumes the corresponding values yi for the dependent variable.

The target function for our experiments is: X4 + X3 + X2 + X

A sample of 20 points with the Xi in the range [-1 1] was chosen to compute the fitness.

Symbolic RegressionSymbolic Regression

Page 20: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

20

Symbolic RegressionSymbolic Regression

CAGE vs Canonical Different population sizes

Page 21: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

21

Symbolic IntegrationSymbolic Integration

Terminal Symbols XFunctions +, -, *, %, sin, cos, exp, rlog

Symbolic Integration consists in searching for a symbolic mathematical expression that is the integral of a given curve.

The target function for our experiments was: cosx + 2x + 1

A sample of 50 points with Xi in the range [0 2] was chosen to compute the fitness.

Page 22: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

22

Symbolic IntegrationSymbolic Integration

CAGE vs Canonical Different population sizes

Page 23: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

23

Even-4 and Even-5 ParityEven-4 and Even-5 Parity

Terminal Symbols d0, d1, d2, d3, (d4)Functions AND, OR, NAND, NOR

In the Even-4 and Even-5 Parity we want to obtain a boolean function that receives 4 (5) boolean variables and gives true only if an even number of variables is true.

The fitness cases are the 24 (25) combinations of the variables.

The fitness is the sum of the Hamming distance between the goal function and the solution found.

Page 24: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

24

Even-4 ParityEven-4 Parity

CAGE vs Canonical Different population sizes

Page 25: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

25

Even-5 ParityEven-5 Parity

CAGE vs Canonical Different population sizes

Page 26: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

26

Ant (Santa Fe Trail)Ant (Santa Fe Trail)

Terminal Symbols Forward, Left, RightFunctions IfFoodAhead, Prog2, Prog3

The ant problem consists in finding the best strategy for an ant that wants to eat all the food contained in a 32x32 matrix.

We used the Santa Fe trail containing 89 pieces of food.

The fitness is the sum of pieces not eaten in a fixed number of moves.

Page 27: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

27

Ant (Santa Fe Trail)Ant (Santa Fe Trail)

CAGE vs Canonical Different population sizes

Page 28: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

28

Royal TreeRoyal Tree

Terminal Symbols X Functions A, B, C, D, E

The Royal Tree Problem is composed from a series of functions a, b, c, … with increasing arity.

The fitness is the score of the root. Each function computes the scores by summing the weighted scores of the children.If the child is not a perfect tree, the score is multiplied for a penalty factor.

The problem has a unique solution, we stopped at level-e tree (326 nodes and 122880of score).

Page 29: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

29

Royal TreeRoyal Tree

CAGE vs Canonical Different population sizes

Page 30: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

30

Related WorkRelated WorkNo approaches using the grid model and a few with the island model can be No approaches using the grid model and a few with the island model can be found in literature.found in literature.

1,000-Pentium Beowulf-Style Cluster Computer for Genetic Programming1,000-Pentium Beowulf-Style Cluster Computer for Genetic Programming

Niwa and Iba describe a parallel island model realised on a MIMD Niwa and Iba describe a parallel island model realised on a MIMD supercomputer and show experimental results for three different topologies: ring, supercomputer and show experimental results for three different topologies: ring, one way and two way torus (the best).one way and two way torus (the best).

Punch discusses the conflict results using multiple populations, for the Ant and Punch discusses the conflict results using multiple populations, for the Ant and the Royal Tree problem.the Royal Tree problem.

We run CAGE with the same parameters of these two islands model in order to We run CAGE with the same parameters of these two islands model in order to compare the convergence.compare the convergence.

Page 31: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

31

Niwa and Iba (cos2x)Niwa and Iba (cos2x)

CAGE Niwa and Iba

We obtained a fitness value of 0.1 in the 20th generations, instead of 62th of Niwa (ring topology).

Page 32: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

32

Niwa and Iba (Even-4 Parity)Niwa and Iba (Even-4 Parity)

CAGE Niwa and Iba

At the 100th generation Niwa has a fitness of 1.1, while our approach is very close to 0.

Page 33: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

33

Convergence Analysis (fitness Convergence Analysis (fitness diffusion)diffusion)

Page 34: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

34

Scalability (Isoefficiency metric)Scalability (Isoefficiency metric) Experimental methodExperimental method

External criterium: evaluating how much a priori known similarities are recognized

Classes of structurally homogeneous documents all documents in each class are conform to the same DTD different classes correspond to different DTDs

Test resultsTest results Picture of the similarity matrix, where pixel the grey levels are

proportional to the corresponding values in the matrix darker pixels correspond to higher similarity values

Quantitative measures average intra-class similarity, for each class average inter-class similarity, for each couple of classes

Page 35: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

35

Scalability resultsScalability results

Page 36: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

36

Classification (Preliminary results)Classification (Preliminary results)

Genetic Programming is suitable for Data Genetic Programming is suitable for Data Classification.Classification.

Good capacity to generalise.Good capacity to generalise.

The dimension of solutions is smaller than See5.The dimension of solutions is smaller than See5.

Needs large populations for real datasets.Needs large populations for real datasets.

Bagging and boosting to partition datasets.Bagging and boosting to partition datasets.

Page 37: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

37

DECISION TREES AND GPDECISION TREES AND GP

NODES NODES ATTRIBUTES ATTRIBUTES FUNCTIONS FUNCTIONS

ARCS ARCS ATTRIBUTE VALUES ATTRIBUTE VALUES ARITY OF THE FUNCTIONS ARITY OF THE FUNCTIONS

LEAFS LEAFS CLASSES CLASSES TERMINAL TERMINAL

Page 38: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

38

Grid and Parallel Asynchronous GPGrid and Parallel Asynchronous GP

Using grid for supercomputing (idle, etc...)Using grid for supercomputing (idle, etc...)

Computational grid needs applicationsComputational grid needs applications

Problems (Different computational power,… Problems (Different computational power,… Drawbacks Classical parallel algorithms: need Drawbacks Classical parallel algorithms: need large bandwidth, synchronism, etc..)large bandwidth, synchronism, etc..)

Parallel Asynchronous Cellular GPParallel Asynchronous Cellular GP

Page 39: CAGE: A Tool for Parallel Genetic Programming Applications Gianluigi Folino.

What is GP ScalabilityConvergenceCAGE Future

WorksWhy Parallel

GP

39

Information RetrievalInformation Retrieval

Query Expansion and Specific Domain Search Query Expansion and Specific Domain Search EngineEngine

Problem: How do we combine the words? Problem: How do we combine the words? Answer: Use GP to add keywords with operators Answer: Use GP to add keywords with operators AND, not, or, near).AND, not, or, near).

Alternative: Specify query using natural language Alternative: Specify query using natural language and specifying with operators.and specifying with operators.