Evolutionary Algorithms - Lehrstuhl für Informatik 2 ...

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

23 Οκτ 2013 (πριν από 3 χρόνια και 9 μήνες)

71 εμφανίσεις

Evolutionary Algorithms

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Overview


Motivation


Nature as a Standard


Genetic Algorithms


Genetic Programming


Evolutionary Strategies


Conclusion

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Motivation


Since millions of years creatures populate Earth


By changes in the biosphere there are again and again new environmental
conditions


Populations had to learn to adapt to the new conditions; permanent stepwise
development, few stagnancy


Organisms are optimally adapted with respect to their needs


Nature has its own laws, rules, strategies, and mechanisms

'
Evolution: successful, robust mechanism, allows creatures over generations to
adapt to environmental conditions

'
Goal of evolution is not predefined; optimisation, innovation, creativity

'
Selection factors: competition, food supply, enemies, climate, environment,
via human beings additionally breed,

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Overview


Motivation


Nature as a Standard


Genetic Algorithms


Genetic Programming


Evolutionary Strategies


Conclusion

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Nature as a Standard
-

Evolution, Genome


Lamarck's thesis (1809):

Adaptation, urge to perfection (by
specific needs) spontaneous creations, heredity of acquired
characteristics (somatic induction)
-
> no feedback in genome


Darwin's thesis (1859):

permanent evolution, common descent,
multiplication of species, gradual change, natural selection,

descending of characteristics with modification

Basic conditions:
too rich

production of genetic variations,
limitation of resources (competition)

Fitness:

suitability, result of multiple interactions with selection
factors of the environment

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Nature as a Standard
-

Evolution, Genome


Gene:

functional unit, relative short segment of DNA, information
how to build a protein molecule


Gene
-
pool:

sum of all genotype
-
variants of a population


Genotype:

all the genes (genome), generally structures, contain
information, instructions to define individual characteristics


Phenotype:

interpretation of the genes, expression of the genome as
individual characteristics, competes with other phenotypes for
reproductive success in a specific setting (basic conditions of the
environment) => selection filter

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Overview


Motivation


Nature as a Standard


Genetic Algorithms


Classic Always Algorithm


Selection


Representation of Hypothesis


Genetic Operators


Procedure of Evolution


Schema Theorem


Applications


Genetic Programming


Evolutionary Strategies


Conclusion

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Genetic Algorithms


John H. Holland 1975 ; David E. Goldberg 1986


Goal of optimisation, "generate
-
and
-
test beam search"


Variability (Heterogenity of the characteristics, singleness, variety)


Differential fitness (propagation rate depends on the ability to survive in
a specific setting, to reproduce descendants)


Heritable fitness (circulate the

genome, incomplete copy,

by mixture of different

descendants)


Dualism Genotype/Phenotype





Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Classic Always Algorithm


Coding, structures


r
epresentation of hypothesis and individuals


Interpretation function


what does the coding represent?


Fitness function

shall be optimised


Termination criteria


is the optimum approximately reached?


Selection function



which individuals determine the next population?


Initialise:

generate randomly n individuals for the initial population P(0)


Evaluate:

determine for all


t := 0 Generation 0


while not


Selection:

choose stochastically individuals according to their fitness




Crossover:

create children via the recombination of parental individuals


from

P'


Mutation:

change randomly the representation of child individuals from

P'


Update:

put n, randomly picked child individuals from
P'

to

P(t+1)


t := t + 1
increment generation


Evaluate



return
Individual with highest fitness value


Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Representation of Hypothesis


Coding

Representation of the parameters (hypothesis, individuals) to be
optimised by structures over a discrete alphabet, mostly bit
-
strings


s = (0100111101)


s = (atggcaact)

with alphabet
A = {a, t, g, c}



Interpretation

Mapping
p

from the genotypical structure space into the phenotypical
characteristics and behaviour space


Production system

s = (10 01 1 11 10 0
) :
IF

a1=T

&
a2=F

THEN

c=T

;


IF

a2=T

THEN

c=F



Triplet : amino acid

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Selection


Best fitting individuals shall build a descendant

population, one
-
sidedness shall be avoided by

stochastic selection algorithms


Fitness
-
proportional selection:
Roulette algorithm



proportional to their own fitness, indirectly proportional to
competitors. Problem: Super individuals may

dominate too much


Rank
-
based selection:


Individuals are sorted ascendingly according to their

fitness; selection is done by a roulette algorithm based


on the position in this ranking

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Genetic Operators


Mutation

Mutation probability, uniformly distributed random number






With a discrete alphabet and a maximal mutation distance, to limit
variation. Defining the distance measure of the alphabet



P

= 0.5

01
10
01
1
0
10

--
> 01
01
01
0
0
01

bit
-
wise


c
geeh
adcd
h
h
--
> c
hdc
gadcd
f
h Mutation distance 2 (lexicographic)

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Genetic Operators (2)



Multipoint analogous, e.g. uniformly or odd
-
even:


0
1
1
0
0
1
1
0
1
0

0011001111

Mask: 1212121212


1
0
1
1
0
0
1
1
1
1

1110011010


Multi
-
recombination (more than 2 parental chromosomes):


random selection of 2 parents, as above


several parents


01
100
11010
\


1011001111


01
0000000
1

-

0110010001

Mask: 3311144443


11011
1000
0 /

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Genetic Operators (2)


Recombination (Crossover)



Crossing point(s) randomly determined or by a fixed mask


Single
-
point:



011
0011010

0111001111

Crossing point: 3


101
1001111

1010011010

Mask: 1112222222


Dual
-
point:


bba
fde
acca

bbabacacca

Crossing points: 3, 6


ede
bac
bfbb

edefdebfbb

Mask: 1112221111

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Genetic Operators (3)



Inversion


mirrored (generally: permuted) insertion of the middle part


1010
0111
01
--
> 1010
1000
01 inverted


fgbbcd
adace

--
> fgbbcd
cdaea

permuted


Deletion

loss of an arbitrary part


1010
0111
01
--
> 101001


intercalar


fgbbcda
dace

--
> fgbbcda terminal


Duplication


duplication of an arbitrary part

1010
011
101
--
> 1010
011011
101


fgbbcda
dace

--
> fgbbcda
dacedace

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Procedure of Evolution


Example: global maximum of a (multi
-
modal) function

Bit
-
vectors:


Interpretation: as in the example


Evaluation: compute the function at the interpreted location




5 (3) Populations independently of each other


Strategies:



population size, recombination partner, create descendants,
mutate


Plus selection from parents and mutated children


Comma selection from mutated children, individuals
survive at most one generation


Variants

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Schema Theorem


Schema:

word over alphabet A*


Instance:

all words which are equal to at the fixed positions


Order:

o(H)

number of fixed elements


Defining length:

segment length between the outermost fixed positions


e.g. A = {a,b,c}, = (b, *, c, a, *, *) ; o( ) = 3 , = 4
-

1 = 3


Instances: (b,
a
, c, a,
a, a
) , (b,
b
, c, a,
b, c
) , (b,
c
, c, a,
c, a
)


Premises:

infinite large population, single
-
point
-
crossover, punctual mutation


Which templates survive (stay instances of the schema)?


exponential propagation, if


Selection: more than average fitness


Recombination: short defining length


Mutation: few fixed positions


As compact as possible conglomeration of gene groups, which are
responsible for the increased fitness:
building blocks


Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Applications


Can be run easily in parallel


In combination with gradient algorithms (hill
-
climbing): Maximum search for rough
restriction of the search space


Simulation of living cells


Production system as an extension to expert systems


Planning optimisation (storage, production processes, ...)


Optimal game strategies


Travelling
-
Salesman
-
Problem: structure contains indices of the nodes in visiting
order. To visit each node exactly once: modification of the genetic operators


Evolution of the structure of neural nets: representation organised in segments
depending on the number of output
-
neurones; codes the number of layers, hidden
neurons and according weights

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Overview


Motivation


Nature as a Standard


Genetic Algorithms


Genetic Programming


Representation of the Hypothesis


Differences to GA


Applications


Evolutionary Strategies


Conclusion

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Genetic Programming


John R. Koza, 1989


Further development of the idea of genetic algorithms


Genetic creation and optimisation of computer programs for special
problem
-
areas


Representation of the Hypothesis


Differences to GA


Applications

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Representation of the Hypothesis


Computer program as tree structure (like parse
-
tree, LISP
-
Syntax)


Combining elements: definition of terms and functions


Arithmetic expressions: {PLUS2, MINUS2, MULT2, DIV2}


Functions: {SIN1, COS1, EXP2, LOG2, ...}


Relations, conditional statement: {LESS2, EQUAL2, IF
-
THEN
-
ELSE3, ...}


Problem related: {TURN
-
LEFT, PICK
-
UP, MOVE
-
RANDOM, ...}


Tree structure: IF
-
THEN
-
ELSE


LESS MULT ADD


A B A C B C


LISP
-
Syntax:


( IF
-
THEN
-
ELSE ( LESS A B ) ( MULT A C ) ( ADD B C ) )


Closed under composition


Complete according to the problem to be solved

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Differences to GA


Recombination



Exchange arbitrarily chosen sub
-
trees


Random determination of the
crossing points


Even with identical terms mostly
new structure pairs


Both children survive


Mutation



Substitution of a sub
-
tree by a newly
generated sub
-
tree


Random selection of a node


Substitution by a randomly new term
which is correctly generated out of
building blocks

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Differences to GA


Recombination, Mutation: context
-
sensitive variation


Selection: matches the algorithmic solution of the given problem


Formulation as fitness value, e.g.


Distance measure for numeric problems


Successfully solved / identified cases


Copy operator: copies a GP
-
chromosome unchanged into the next
generation


Each genome is only modified by a single operator: selection between
operators


Extension of terms to symbolic expressions

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Genetic Programming (Example)


Minimise a Boolean function

24

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Genetic Programming

(Example Results)


1000 individuals, 1000 steps (8 minutes)


starting length: 127, results 71, 57

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Applications


Ant searching for food on a minimal route


Classification of groups belonging together for complex areas, e.g.
swallowed spirals


Robots searching for objects and doing precisely oriented moves


Robots following walls


Random number generator with a distribution as uniformly as possible


Backwards docking of a truck with its hanger


Steering a robot arm with two joints to points in a field


Design of electronic circuits for analogous filters

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Overview


Motivation


Nature as a Standard


Genetic Algorithms


Genetic Programming


Evolutionary Strategies


Idea, basic Principles


Differences to GA


Applications


Conclusion

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Evolutionary Strategies


Ingo Rechenberg, 1964 / 1994


Adaptation of the basic mechanisms of natural evolution to
technical optimisation problems by engineering sciences


Root: evolutionary experimental methods, focussed on the
physical experiment


Results of the (at that time) unorthodox methods could not be
analytically founded or reproduced


Idea, basic principles


Differences to GA


Applications

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Development, Idea


Given: experimental equipment with variable parameters


Mechanic: changing position by pitch and angle


Elastic: outline by bending


Combination of segments of different sizes


Random change of the parameters in a certain area (mostly
binomially distributed: little mutation prefered)


Measuring the experimental result: if getting worse then back
propagation of the changes


Repeat until optimum is found


Representation: Parameter as real
-
valued vector


Original experiment: orthogonal pipe redirection with smallest loss

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Development, Idea (2)

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Differences to GA


Algorithmic representable, expandable to populations / several descendants


Representation expanded by strategy parameters:


Describe variance for controlling the mutation spreading of the appropriate
parameter, can be integrated in the optimum search (adaptation of the
increment)


Real
-
valued structures: adaptation of the genetic operators


Mutation:

numeric deviation ; Gauss distributed

random number, average 0, variance


Recombination:

discrete (randomly copied from the one or the other parent
chromosome), intermediary (average building), local (single individuals),
global (whole population)


Random selection, no proportionality of the fitness


Surplus of descendants, selection of the best for succeeding population

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Evolutionary Strategies (Example)


Fluid storage


Changeable shape


Fixed volume


Minimal surface

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Evolutionary Strategies

(Example Results)


100 individuals


100 generations

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Applications


Pressure output of a two phases supersonic cone, segments with variable
diameter






Flow resistance of a joint plate, 5 joints with 51 engaging levels (0, +,
-
) each


Rotation body form with little flow resistance, air plane ... dolphin spindle


Minimal weight construction of a bow bridge


Flexion of a lens for concentration on focus


Magic square: 30x30 with m
agic sum 13525


Networking with minimal lengths and a given branching degree

Lehrstuhl für Informatik 2

Gabriella Kókai: Maschine Learning

Conclusion


Evolutionary algorithms solve optimisation problems


Standard is the natural evolution, which produces permanently new and partly
improved organisms, which must assert themselves in their environment


Basis is the biological adaptation as a learning procedure of populations of natural
organisms


Hypotheses are interpreted and evaluated by a fitness function


The hypothesis room is explored by a stochastic search: Selection as fitness
proportional procedure


New hypotheses come up by recombination and mutation, similar to the chromosomes
of organisms


The representation can be done by bit
-
strings/character
-
strings (GA), programs as term
and function trees (GP) or real
-
valued parameter vectors (ES)


The convergence of the algorithms is mostly very good, but not guaranteed


They work also with complex problems, where other algorithms have failed on or are
not (yet) known