Evolutionary Computation - UCL Computer Science

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

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

105 εμφανίσεις

EVOLUTIONARY COMPUTATION

-

1

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.






EVOLUTIONARY COMPUTATION








BOOKS:

Christian Jacob (2001)
Illustrating Evolutionary
Computation with Mathematica
. Morgan Kaufmann.

Peter J. Bentley (2001)
DIGITAL BIOLOGY “Evolution
chapter” (3).


EXTRA READING:


David Goldberg (1989)
Genetic Algo
rithms in Search,
Optimization and Machine Learning
. Addison
-
Wesley.


Melanie Mitchell (1996)
An Introduction to Genetic Algorithms
.
MIT Press.

EVOLUTIONARY COMPUTATION

-

2

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.




Evolutionary Computation



Evolution can modify genes and organisms, words and
languages.


It can also modify

binary digits.


EVOLUTIONARY COMPUTATION

-

3

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.


If we set up a population of individuals in a computer,


allow some to be selected by some criterion


and allow those individuals to produce children


which inherit features from their parents with some
variation


and then select those

according to the criterion and so
on…



…you get evolution in a computer.


EVOLUTIONARY COMPUTATION

-

4

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.



Evolutionary computation is the field of computer science
(related to artificial intelligence or artificial life) that studies
programs that evolve solutions to problems.



Evol
utionary algorithms come in many different varieties,
but underneath the differences, they are all the same.



They all have reproduction with inheritance, variation and
selection.

EVOLUTIONARY COMPUTATION

-

5

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.




There are four major types of evolutionary algorithm
commonly used by r
esearchers and in industry:


Genetic Algorithms (GAs)

Genetic Programming (GP)

Evolutionary Strategies (ES)

Evolutionary Programming (EP)


GAs, ES and EP were all independently ‘discovered’ by
researchers in the 1960s. GP was created in the early
1990s, an
d is a specialised type of GA.


Of them GAs and GP are perhaps the most commonly
used, so this course will focus on these.

EVOLUTIONARY COMPUTATION

-

6

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.


What do we evolve?


Genetic algorithms (GAs) were first created by John
Holland in the 1960s.


They only became commonly used by re
searchers in the
late 1980s and 1990s.


Today hundreds of researchers have applied GAs to
countless problems.


Applications include: fraud detection systems, robot
controllers, schedulers, design of architecture,
composition of music, and even investigatio
ns of how life
began.


We’ll look at three here, to give you an idea of what can be
achieved:




Axelrod’s Iterated Prisoner’s Dilemma



Karl Sims’ evolved “virtual creatures”.



Steven Rooke’s evolutionary art

EVOLUTIONARY COMPUTATION

-

7

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.


Axelrod’s Iterated Prisoner’s Dilemma


The Iterat
ed Prisoner’s Dilemma is a little game that is
used to represent hundreds of similar situations in real life.


It can be used to model reciprocal bird preening
behaviour, countries trading together, and many other
systems.


The prisoner’s dilemma itself is

very simple:


Imagine two prisoners are being interrogated in separate
rooms.


Each has a choice: either
cooperate
with his partner and
tell the same story, or
defect

and turn the other in. And
neither knows what the other will do.

EVOLUTIONARY COMPUTATION

-

8

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.

So there are four poss
ible outcomes:



Prisoner 2 defects

Prisoner 2 cooperates

Prisoner 1 defects

P1:

1
P2:

1

P1:

5
P2:

0

Prisoner 1 cooperates

P1:

0
P2:

5

P1:

3
P2:

3


If they both defect and turn each other in, they’ll both do
badly.


If Prisoner 1 defects, but Pr
isoner 2 cooperates, then
Prisoner 1 will do very well, and Prisoner 2 will do very
badly.


Likewise, if Prisoner 2 defects, but Prisoner 1 cooperates,
then Prisoner 2 will do very well, and Prisoner 1 will do
very badly.


Finally, if they both cooperate a
nd tell the same story, both
will do OK (but not as well as they could have done if one
had defected).


The dilemma is thus: what should each prisoner do?


EVOLUTIONARY COMPUTATION

-

9

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.



The
Iterated

Prisoner’s Dilemma is exactly the same
situation, played over and over again.



When

you play the same game a number of times, it is
possible to build up knowledge about your opponent.



For example, if he/she always seems to defect, then your
best bet is to defect as well.



But if he/she always seems to cooperate, then perhaps
you shoul
d try defecting and go for a higher payoff.



The problem is thus: how do you build a playing strategy
which best makes use of your knowledge of your
opponent’s previous moves?

EVOLUTIONARY COMPUTATION

-

10

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.



Robert Axelrod held several competitions, where people
had to write computer

programs that played each other.


He discovered that one of the best strategies was “Tit for
Tat”.


This strategy always began by cooperating, but then
simply played the previous move of the other player.


So if your opponent cooperated, you cooperate in
the next
game.


If your opponent defected, you defect in the next game,
and so on.

EVOLUTIONARY COMPUTATION

-

11

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.


Axelrod then did something more interesting.


He used a genetic algorithm to
evolve

strategies, and
made them play all of the other programs submitted to the
competition.


Evolution selected those strategies that were better able
to win the IPD, and made them have more children.


Because the children inherited genetic material from their
parents (binary genes), and because these genes were
randomly mutated now and again, th
ey resembled their
parents with some variation.


Selection with inheritance and variation caused better and
better IPD strategies to evolve.


The result was a strategy that behaved in a very similar
way to Tit for Tat


evolution agreed with Axelrod’s
prev
ious finding.

EVOLUTIONARY COMPUTATION

-

12

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.



Other researchers continued his research.



Instead of using a GA to evolve a strategy that would win
when playing a set of fixed strategies, researchers have
co
-
evolved
strategies that play each other.



What kind of strategy almost alway
s evolved?



Co
-
operation from both players.



Can you work out why?

(We’ll return to this in later lectures.)

EVOLUTIONARY COMPUTATION

-

13

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.


Karl Sims’ virtual creatures

(chapter 13 in
Evolutionary Design by Computers

edited by Peter J Bentley)


Karl is an artist and specialist in co
mputer graphics


today he develops special effects for movies.


Karl had the idea of using a genetic algorithm rather like
evolution in nature: use it to evolve creatures that could
move themselves around in an environment.


This, of course, was very comp
licated. He needed a
model of the world including forces, moments, inertia,
gravity, friction, water
-
resistance, and light.


He also needed to set up “digital DNA” or
genetic
encodings

that would be modified by the GA


The genetic encoding would define the

neural networks of
the creatures (their brains) and their morphologies (their
bodies).

EVOLUTIONARY COMPUTATION

-

14

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.


Karl “asked” his genetic algorithm to evolve creatures that
were good at moving and that could follow a light source.


So the faster they could propel themselves (or
the better
they could find the light), the more children they had.


As usual, the children inherited genes from their parents,
and there was variation caused by random mutations.


The results caused a huge impact on computer scientists,
biologists (and the

media at the time).

EVOLUTIONARY COMPUTATION

-

15

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.


Turtle
-
like creatures evolved, that could propel themselves
through the water with flippers and follow a red light:









(stills from Sims’ movi
e)
EVOLUTIONARY COMPUTATION

-

16

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.



Creatures walked over the ground like inch
-
worms:










Snake
-
like creatures evolved, that undulated through the
water:












EVOLUTIONARY COMPUTATION

-

17

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.



Some more snake
-
like creatures:

















EVOLUTIONARY COMPUTATION

-

18

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.



As well as having complex bodies, all of Karl’s virtual
creatures had immensely com
plicated neural networks,
enabling them to move and sense within their
environments.


If you want to play with a similar system, look for Jeffery
Ventrella’s free software “Gene Pool” or “Darwin Pond” at
www.ventrella.com


it evolves 2D water creatures in

real
time on your PC.

EVOLUTIONARY COMPUTATION

-

19

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.



Steven Rooke’s evolutionary art

(chapter 10 in
Creative Evolutionary Systems

edited by Peter J Bentley and
David W Corne)


As mentioned earlier,
genetic programming

(GP) is a
newer type of genetic algorithm.


The idea of genetic p
rogramming comes from ideas of
automatic programming
, or enabling computers to
program themselves.


GP does not evolve game
-
playing strategies or virtual
creatures


it evolves computer programs.

EVOLUTIONARY COMPUTATION

-

20

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.



Normally, a GP system is given a series of
exemplars



ex
amples of what a program should output for different
inputs.


GP then has to go away and evolve the right set of
instructions to make a computer program, which when run,
produces a matching set of outputs for the different inputs.


As before, fitter indivi
duals (programs) have more children,
the children inherit genes from their parents with some
random mutations.


And evolution writes novel computer programs.

EVOLUTIONARY COMPUTATION

-

21

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.



Steven Rooke had the idea of getting a computer to
generate art.



Rather than write a program
which just displayed a pretty
picture (e.g. a fractal), Steven wanted a program that
could generate pictures that he liked.



So he used genetic programming to evolve computer
programs that displayed pictures.


EVOLUTIONARY COMPUTATION

-

22

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.



To judge how effective the programs were a
s they
evolved, he simply judged how much he liked the pictures
they produced.



A nicer picture (in his opinion) meant that the
corresponding program was awarded a higher fitness
score.



The programs with better fitnesses had more children, the
children
inherited genes from their parents, etc, etc.



The evolved result was a computer program that
generated a very nice (or at least interesting) image.



And a different program (and hence a different image) was
evolved every time the GP system was run.
EVOLUTIONARY COMPUTATION

-

23

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.

Here
’s what some looked like:


"In the Beginning"

© 1996 Steven Rooke 1996, 427 nodes, fractals are black
-
box.


"Skaters"

© 1997 Steven Rooke, 81 nodes, fractals are black
-
box.

EVOLUTIONARY COMPUTATION

-

24

-

© 2001 Peter J. Bentley. Slide for UCL M.Sc. Evolutionary Computation course.


"Pearly Gates",
© 1999 Steven Rooke, true genetic fract
al.