Genetic Expression Programming

yalechurlishΤεχνίτη Νοημοσύνη και Ρομποτική

7 Νοε 2013 (πριν από 3 χρόνια και 11 μήνες)

179 εμφανίσεις

Presentation

Genetic

Expression Programming

GE
P

quick overview


Developed: 2001


Early names: C. Ferreira


Attributed features:


GEP has similarities, but is distinct from genetic programming.


Mathematical modeling by an artificial intelligence


Fixed length composed of one or more genes


Special:


Linear chromosomes


Works with two entities: chromosomes and expression trees


Recombination operators

GEP technical summary tableau

Representation

Symbolic string

Recombination

Exchange some material
between two chromosomes

Mutation

Two one
-
point mutations

per chromosome

Parent selection

According to fitness by
roulette
-
wheel

Survivor selection

Generational replacement

Representation


Chromosome consists of a linear, symbolic
string of fixed length composed of one or more
genes.


How the chromosomes work as genotype and
the expression trees as phenotype.


Candidate solution represented by an
expression tree(ET) (similar with GP tree)


ET encoded in a chromosome


Representation


ET encoded in a chromosome:

read ET from left to right and from top to
bottom(exactly as we read a page of text)


Decoding the chromosome (translates the
chromosome in an ET) :

First line of ET (root)


first element of the
chromosome.

Next line of ET


as many arguments needed
by the element in the previous line


Representation


The genes of GEP are composed of a head
and a tail:


Head: contains both functions and terminals
(length h)


Tail: contains only terminals (length t)



t=h(n
-
1)+1



n = number of arguments of the function with
the highest number of arguments



Representation Example

Expression tree (ET)

Example, the algebraic expression:

)
(
)
(
d
c
b
a



Q

+

*

d

-

c

a

b

ET encoded in a chromosome

Q*
-
+abcd


Q means sqrt

Translation


Representation Example

Set of functions: Q,*,/,
-
,+

Set of terminals: a,b

n=2; h=15 (choosen) => t =16

length of gene=15+16=31

*b+a
-
aQab+//+b+
babbabbbababbaaa

*

b

+

-

a

Q

a

a

ET ends before the end of the gene!

GEAP flowchart

Creation of the initial population



The chromosomes of the individuals of the
initial population are randomly generated using
the symbols representing the functions and
terminals chosen to solve the particular
problem.


The choice of the function :

for example
boolean

functions AND, OR, and
NOT

The Initial population Example




Generation N: 0

1.23456E+12

NacababAANaccb
-
[0] = 2

AOAaccaNcOabcc
-
[1] = 4

ObNaabaAONaacb
-
[2] = 3

OObacbcANNcccc
-
[3] = 4

NNNabcbOAaacbc
-
[4] = 4

NbbbcccAaOabbc
-
[5] = 4

AbNbbaaAaAbcac
-
[6] = 5

OcOccaaOOAaabb
-
[7] = 5

OOcacabNNNbbcb
-
[8] = 5

ObbbabbNbAccbc
-
[9] = 4

Reproduction with modification


Genetic operators applied on chromosoms not
on ET.


Always produce syntactically correct structures !


Reproduction contains:


Replication


Recombination


Mutation


Transposition

Replication


Copies exactly the genomes of all the selected
individuals



All the remaining operators randomly pick up
the chromosomes to be subjected to a certain
modification



The selection operator selects individuals
according to fitness and the luck of the roulette.

Mutation


Use a mutation rate
p
m

equivalent to two one
-
point
mutations per chromosome.



Mutations can occur anywhere in the chromosome.
however, the structural organization of chromosomes
must be preserved.



Header :
symbol => (function or terminal)


Tails : terminals => terminals

Mutation Example

012345678012345678012345678

-
+
-
+
abaaa
/bb/
ababb
*Q*+
aaaba

012345678012345678012345678

Q+
-
+
abaaa
/
bb
Q
ababb
*b*+
aaaba

Resulting ET will be valid as long as the tail doesn’t contain
functions.

Transposition


The
transposon

is copied and the copy is then inserted at
a randomly chosen point in the head of a gene, except the
first position.



A transposition rate
p
is



The transposition operator randomly chooses the
chromosome, the start of the IS element, the target site,
and the length of the
transposon
.



Insertion Sequence (IS)
Transposition Example

012345678901234567890
012345678901234567890

*
-
+*a
-
+a*
b
babbaababab
Q
**+
abQbb
*
aa
bba
aaabba


012345678901234567890
012345678901234567890

*
-
+*a
-
bba
+
babbaababab
Q
**+
abQbb
*
aabbaaaabba

The position and the length of the IS must be determined.

Resulting ET will be valid, because the change is upstream.

Root Insertion Sequence (RIS)
Transposition Example

012345678901234567890
012345678901234567890

-
ba*+
-
+
-
Q/
abababbbaaa
Q*b/
+bb
abb
aaaaaaaabbb


012345678901234567890
012345678901234567890

-
ba*+
-
+
-
Q/
abababbbaaa
+bb
Q*b/
+bb
aaaaaaaabbb

The position and the length of the RIS must be determined.

Resulting ET will be valid, because the change is upstream.

Gene Transposition Example

012345678012345678012345678

*a
-
*abbab
-
QQ/aaabb
Q+abababb

012345678012345678012345678

-
QQ/aaabb
*a
-
*abbabQ+abababb

No effect on genes, but can change the linking of genes.

Recombination


In GEP there
are three kinds of recombination:


One
-
point


Two
-
point


Gene recombination


All types of recombination, two chromosomes are
randomly chosen and paired to exchange some
material between them.


One
-
point recombination


In one
-
point recombination the parent chromosomes
are paired and split up at exactly the same point.



The material downstream of the recombination point is
afterwards exchanged between the two chromosomes.


One
-
point recombination Example

012345678012345678

-
b+Qbbabb/aQbbbaab

/
-
a/ababb
-
ba
-
abaaa

012345678012345678

-
b+
/ababb
-
ba
-
abaaa

/
-
a
Qbbabb/aQbbbaab

Second gene was not modified.

Both offspring will always be valid.

Two
-
point recombination


In two
-
point recombination the parent
chromosomes are paired and two points are
randomly chosen by which both chromosomes
are split.


The material between the recombination points
is then exchanged between the two
chromosomes.


Two
-
point recombination Example

0123456789001234567890

+*a*
bbcccac
*
baQ
*
acabab

*
cbb+cccbcc
++**
bacbaab


0123456789001234567890

+*a*
bbc
cbcc
++*
Q*
acabab

*
cbb+cc
ccac
*
ba
*
bacbaab

Both offspring will always be valid.

Gene recombination


Entire genes are exchanged between two
parent chromosomes.


012345678012345678012345678

/
aa
-
abaaa
/a*
bbaaab
/Q*+
aaaab

/
-
*/
abbabQ+aQbabaa
-
Q/
Qbaaba

012345678012345678012345678

/aa
-
abaaa
Q+aQbabaa
/Q*+aaaab

/
-
*/abbab
/a*bbaaab
-
Q/Qbaaba

Multigenic

Chromosomes

Hierarchical discovery technique

012345678012345678

Q*
Q+
bbaaa
*
-
ba
baabb

Multigenic

Chromosomes

012345678901201234567890120123456789012

IIAI
ca3aa2acu
NNAO
ab2u3c31c
Au12
ua3112cac

13 = h + t

t = h (n
-
1) + 1


h = 4, t = 9

Multigenic

Chromosome Benefits


Evolving components of a solution not just solutions.



Separation of tasks and abstraction of details like in the
engineering done by humans.



Similar to:


Structured Programming


Functions


Object Oriented


Design Patterns

You Can Have Extra Genes

Best Fitness
vrs
. Average Fitness

Discussion



What’s the difference between GEP and GP ?

Is GEP similar to GA? How?

Thanks


You can find an example here:


http://www.gene
-
expression
-
programming.com/GepBook/Chapter3/Section4.htm



References

Gene Expression Programming: A New Adaptive Algorithm for Solving Problems

by Candida Ferreira

http://www.gene
-
expression
-
programming.com/webpapers/gep.pdf

Gene Expression Programming

http://www.gene
-
expression
-
programming.com

GeneXproTools

http://www.gepsoft.com