21
Genetic Programm ing Architecture- Altering Operations Are used to change the architecture of individuals containing the following automatically defined constructs: Automatically Defined Functions (ADFs) Automatically Defined Iterations (ADIs) Automatically Defined Loops (ADLs) Automatically Defined Recursions (ADRs) Automatically Defined Storage (ADSs)

Architecture-Altering Operations

  • Upload
    milos

  • View
    51

  • Download
    0

Embed Size (px)

DESCRIPTION

Architecture-Altering Operations. Are used to change the architecture of individuals containing the following automatically defined constructs: Automatically Defined Functions (ADFs) Automatically Defined Iterations (ADIs) Automatically Defined Loops (ADLs) - PowerPoint PPT Presentation

Citation preview

Page 1: Architecture-Altering Operations

Genetic Programming

Architecture-Altering Operations

Are used to change the architecture of individuals containing the following automatically defined constructs: Automatically Defined Functions (ADFs) Automatically Defined Iterations (ADIs) Automatically Defined Loops (ADLs) Automatically Defined Recursions (ADRs) Automatically Defined Storage (ADSs)

Page 2: Architecture-Altering Operations

Genetic Programming

Architecture-Altering Operators

The following architecture-altering operators are defined for each automatically defined constructs Construct duplication Construct deletion Construct creation Argument duplication Argument deletion Argument creation

Page 3: Architecture-Altering Operations

Genetic ProgrammingADF Architecture

User specifies architecture All the individuals have the same number of ADFS

with each ADF having the same number of arguments in each individual.

Branch typing is used during crossover and mutation. Architecture is evolved

Each individual has a different architecture, i.e. a different number of ADFs and each ADF has a different number of arguments.

Point typing is used during crossover and mutation

Page 4: Architecture-Altering Operations

Genetic ProgrammingADF Example

progn

defunvalues

ADF0 ARG0, ARG1, values

1

2

3 4 5

6

7

8

ARG2

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG2

-

x

7 7

7 7

8 8

8

ADF0

y

x

x

8

8

Page 5: Architecture-Altering Operations

Genetic Programming

Architecture-Altering Operations: ADFs

Subroutine duplication Argument duplication Subroutine creation Argument creation Subroutine deletion Argument deletion

Page 6: Architecture-Altering Operations

Genetic ProgrammingSubroutine Duplication

Adds a copy of an existing branch to a copy of the chosen parent. Choose a parent Choose a branch Copy the parent and add a copy of the chosen branch. The new function-defining branch is given a different

name. GP Parameters

Application rate Maximum number of ADFs per individual

Page 7: Architecture-Altering Operations

Genetic ProgrammingSubroutine Duplication: Example

1. Copy selected parent

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

x

ADF0

yx

ADF0

x

2. Choose a branch

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

x

ADF0

yx

ADF0

x

3. Insert a copy of the chosen branch

4. Rename the ADF

5. Share function calls

defun

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG2

values

-

x

ADF0

yx

ADF0

x

defun

ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

progn

ADF0

defun

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

values

-

x

ADF0

yx

ADF0

x

defun

ADF1ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

progn

defun

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

values

-

x

ADF0

yx

ADF1

x

defun

ADF1ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

progn

Page 8: Architecture-Altering Operations

Genetic ProgrammingArgument Duplication

Copies an existing argument. Select a parent Select an ADF branch Select an argument Extend argument list of the chosen ADF Update results-producing branch Update the function sets of each branch

GP Parameters Application rate of the argument duplication operator The maximum number arguments per ADF Maximum size of the results-producing branch

Page 9: Architecture-Altering Operations

Genetic Programming

Argument Duplication: Example

1. Copy the selected parentprogn

defunvalues

ADF0 ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

ADF0

yx

x

2. Choose an ADF branchprogn

defunvalues

ADF0 ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

ADF0

yx

x

3. Choose an argument

4. Copy the chosen argument

5. Rename the argument

6. Randomly choose each argument occurrence (0 remain as is, 1 change)

progn

defunvalues

ADF0 ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

ADF0

yx

x

progn

defunvalues

ADF0 ARG0, ARG1 values

+

+ ARG0

ARG1 ARG0

+

+ ARG0

ARG1 ARG2

-

ADF0

yx

x

ARG0

progn

defunvalues

ADF0 ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

ADF0

yx

x

ARG2

0

progn

defunvalues

ADF0 ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

ADF0

yx

x

ARG2

1

progn

defunvalues

ADF0 ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG2

-

ADF0

yx

x

ARG2

7. Update the results-producing branch

progn

defun values

ADF0 ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG2

-

ADF0

yx

x

x

ARG2

Page 10: Architecture-Altering Operations

Genetic ProgrammingSubroutine Creation

Creates a new ADF branch Select a parent Select a point N, in the body of a branch. Select arguments for the new ADF from the subtree rooted at N. Create the new branch and give the ADF a name. Replace N with the name of the new ADF and insert the chosen

arguments. GP Parameters

Application rate of the subroutine creation operator. The maximum number of ADFs per individual. The maximum size of an ADF The maximum number of arguments per ADF. The minimum number of arguments per ADF.

Page 11: Architecture-Altering Operations

Genetic Programming

Subroutine Creation: Example

1. Copy the selected parent

progn

defunvalues

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

ADF0

yx

x ++

x

2. Choose a non-invariant node randomly

progn

defunvalues

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

ADF0

yx

x ++

x

3. Traverse the tree rooted at the chosen point to determine the arguments of the new ADF ( 1 indicates chosen point).

1

progn

defunvalues

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

ADF0

yx

x ++

x

0

01

progn

defunvalues

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

ADF0

yx

x ++

x

4. Create the new ADF branch

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

ADF0

yx

x ++

x

defun

ADF1ARG0, ARG1 values

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

ADF0

yx

x ++

x

defun

ADF1ARG0, ARG1 values

-

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

yx

x ++

x

defun

ADF1 ARG0, values

-

ADF0ARG0

ARG1

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

yx

x ++

x

defun

ADF1 ARG0, values

-

ADF0ARG0 ++

ARG1

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

yx

x ++

x

defun

ADF1 ARG0, values

-

ADF0ARG0 ++

x

ARG1

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

-

yx

x ++

x

defun

ADF1 ARG0, values

-

ADF0ARG0 ++

x ARG0

ARG1

5. Replace the chosen node with the new ADF

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

yx

x ++

x

defun

ADF1 ARG0, values

-

ADF0ARG0 ++

x ARG0

ARG1 ADF1

6. Insert arguments of the ADF

progn

defun values

ADF0 ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

yx

x

defun

ADF1 ARG0, values

-ADF0

ARG0 ++

x ARG1

ARG1 ADF1

Page 12: Architecture-Altering Operations

Genetic ProgrammingArgument Creation

Extends the argument set of an existing ADF to contain a new argument Select a parent Choose a node, N, in the body of a function-defining branch. Extend the argument list of the branch containing N to include

another argument. Replace the subtree rooted at N with the name of the new argument. Extend each function call of the ADF branch containing N to include

an additional subtree representing the new argument. GP Parameters

The application rate of the argument creation operator. The maximum number of arguments per individual. The maximum size of the results-producing branch.

Page 13: Architecture-Altering Operations

Genetic Programming

Argument Creation: Example1. Copy the selected parent

progn

defun

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

values

-

y

x

x ++

x

ADF0 ADF0

x

++

x

2. Randomly choose a non-invariant, N, point in an ADF branch

progn

defun

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

values

-

y

x

x ++

x

ADF0 ADF0

x

++

x

3. Extend the argument list of the ADF branch containing N to include another argument

progn

defun

ADF0 ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

values

-

y

x

x ++

x

ADF0 ADF0

x

++

x

ARG2

4. Replace the subtree rooted at N with the new argument label.

ARG2ARG2

5. Update each function call to include an additional subtree.

+

ARG1 ARG2

+

ARG1 ARG0

++

xy

x

++

x x

++

x

++

Page 14: Architecture-Altering Operations

Genetic ProgrammingSubroutine Deletion

Deletes an existing ADF Select a parent. Delete a randomly chosen ADF branch in a copy of the

parent. Replace the functions calls to the deleted ADF

GP Parameters Application rate of the subroutine deletion operator. The minimum number of ADFs per individual. Method to use to replace function calls to the deleted

ADF (consolidation, regeneration or macro expansion).

Page 15: Architecture-Altering Operations

Genetic Programming

Subroutine Deletion by Consolidation

The deleted ADF and the replacement ADF have the same number of arguments

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

yx

x

defun

ADF1 ARG0, values

-ADF0

ARG0 ++

x ARG0

ARG1 ADF1

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

yx

x

defun

ADF1 ARG0, values

-ADF0

ARG0 ++

x ARG0

ARG1 ADF1

progn

values

yx

x

defun

ADF1 ARG0, values

-ADF0

ARG0 ++

x ARG0

ARG1 ADF1

progn

values

yx

x

defun

ADF1 ARG0, values

-ADF1

ARG0 ++

x ARG0

ARG1 ADF1

Page 16: Architecture-Altering Operations

Genetic Programming

Subroutine Deletion by Consolidation

The deleted ADF has more arguments than the replacement ADF

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

yx

x

defun

ADF1ARG0 values

-ADF0

ARG0 ++

x ARG0

+*

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

yx

x

defun

ADF1ARG0 values

-ADF0

ARG0 ++

x ARG0

+*

progn

values

yx

x

defun

ADF1 ARG0 values

-ADF0

ARG0 ++

x ARG0

+*

progn

values

yx

x

defun

ADF1 ARG0 values

-ADF1

ARG0 ++

x ARG0

+*

progn

values

x

x

defun

ADF1 ARG0 values

-ADF1

ARG0 ++

x ARG0

+*

Page 17: Architecture-Altering Operations

Genetic Programming

Subroutine Deletion by Consolidation

The deleted ADF has less arguments than the replacement ADF

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

x

x

defun

ADF1ARG0 values

-ADF1

ARG0 ++

x ARG0

+*

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

x

x

defun

ADF1ARG0 values

-ADF1

ARG0 ++

x ARG0

+*

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

x

x ADF1

+*

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

x

x ADF0

+*

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

x

x ADF1

+*

-

x y

Page 18: Architecture-Altering Operations

Genetic Programming

Subroutine Deletion withRandom Regeneration

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

yx

x

defun

ADF1ARG0 values

-ADF0

ARG0 ++

x ARG0

+*

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

yx

x

defun

ADF1ARG0 values

-ADF0

ARG0 ++

x ARG0

+*

progn

values

yx

x

defun

ADF1ARG0 values

-ADF0

ARG0 ++

x ARG0

+*

progn

values

x

defun

ADF1ARG0 values

-ADF1

ARG0 ++

x ARG0

+*

progn

values

+

x

defun

ADF1ARG0 values

-ADF1

ARG0 ++

x ARG0

+*

xx

Page 19: Architecture-Altering Operations

Genetic Programming

Subroutine Deletion withMacro Expansion

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

yx

x

defun

ADF1ARG0 values

-ADF0

ARG0 ++

x ARG0

+*

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

yx

x

defun

ADF1ARG0 values

-ADF0

ARG0 ++

x ARG0

+*

progn

values

+

+

+

+

x

defun

ADF1ARG0 values

-

ARG0 ++

x ARG0

+*

x

xy

Page 20: Architecture-Altering Operations

Genetic ProgrammingArgument Deletion

Deletes an argument of an existing ADF branch Select a parent. Randomly choose an ADF branch in the copy of a parent. Randomly choose an argument to delete. Delete the chosen argument. Delete the subtree representing the deleted argument in each

function call of the ADF. Replace each occurrence of the deleted argument in the ADF.

GP Parameters Application rate of the argument deletion operator. The minimum number of arguments that an ADF branch must

contain.

Page 21: Architecture-Altering Operations

Genetic Programming

Argument Deletion by Consolidation

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

yx

x ADF0

+*

progn

defun values

ADF0ARG0, ARG1 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG1 ARG0

yx

x ADF0

+*

progn

defun values

ADF0ARG0 values

+

+ ARG0

ARG0ARG2

+

+ ARG0

ARG0

x

x ADF0

+*

progn

defun values

ADF0ARG0 values

+

+ ARG0

ARG1 ARG2

+

+ ARG0

ARG0

x

x ADF0

+*

ARG0