Upload
others
View
6
Download
0
Embed Size (px)
Citation preview
1
Evolution in Computers
• After answering the question “Can a machine reproduce
itself?” in the affirmative, von Neumann wanted to go
further, to have machines reproduce themselves with
mutation and compete for resources to “survive”.
• This would address the “evolution” and “survival instinct”
arguments about artificial life.
• Von Neumann died in 1957 without working on the
evolution problem.
• However, by the 1960s,
several groups were
working on evolution in
computers.
2
Two Paths of Artificial Intelligence
Borrow from biology• Borrow from logic
Evolution by Natural Selection
Charles Darwin
• Organisms inherit traits from parents
• Traits are inherited with some variation, via mutation and sexual recombination
• The organisms best adapted to the environment tend to produce the most offspring.
• This way traits producing adapted individuals spread in the population
3
Evolution by Natural Selection
• Organisms inherit traits from parents
• Traits are inherited with some variation, via mutation and sexual recombination
• The organisms best adapted to the environment tend to produce the most offspring.
• This way traits producing adapted individuals spread in the population
in computers
Computer (e.g., programs)
Charles Darwin
John Holland
Some real-world uses of genetic algorithms
• Used by GE to automate parts of aircraft design
• Used by pharmaceutical companies to discover new
drugs
• Used by the London Stock Exchange to automatically
detect fraudulent trades
• Used to generate realistic computer animation in the
movies Lord of the Rings: The Return of the King and
Troy
• Used to model and understand evolution in nature!
4
Example:
Evolving Strategies for Robby the RobotInput:
Contents of N, S, E, W,
C(urrent)
Possible actions:
Move N
Move S
Move E
Move W
Move random
Stay put
Try to pick up can
Rewards/Penalties (points):
Picks up can: 10
Tries to pick up can on empty site: -1
Crashes into wall: -5
Example Strategy
5
Encoding a Strategy
0 2 6 5 . . . 3 . . . 4
243 values
Genetic algorithm for evolving strategies for
Robby
1. Generate 200 random strategies (i.e., programs for
controlling Robby)
6
Random Initial Population
Genetic algorithm for evolving strategies for
Robby
1. Generate 200 random strategies (i.e., programs for
controlling Robby)
2. For each strategy, calculate fitness (average reward
minus penalties earned on random environments)
3. The strategies pair up and create offspring via “sexual
recombination” with random mutations ― the fitter the
parents, the more offspring they create.
7
Parent 1:
Parent 2:
Parent 1:
Parent 2:
8
Parent 1:
Parent 2:
Child:
Genetic algorithm for evolving strategies for
Robby
1. Generate 200 random strategies (i.e., programs for
controlling Robby)
2. For each strategy, calculate fitness (average reward
minus penalties earned on random environments)
3. The strategies pair up and create offspring via “sexual
recombination” with random mutations ― the fitter the
parents, the more offspring they create.
4. Keep going back to step 2 until a good-enough strategy
is found!
9
My hand-designed strategy:
“If there is a can in the current site, pick it up.”
“Otherwise, if there is a can in one of the adjacent sites,
move to that site.”
“Otherwise, choose a random direction to move in.”
Average fitness of this strategy: 346
(out of max possible ≈ 500)
Average fitness of GA evolved strategy: 486
(out of max possible ≈ 500)???
One Run of the Genetic Algorithm
Be
st fitn
ess in
po
pu
latio
n
Generation number
10
Principles of Evolution Seen in
Genetic Algorithms
• Natural selection works !
• Evolution proceeds via periods of stasis “punctuated” by
periods of rapid innovation
• Exaptation is common
• Co-evolution speeds up innovation
• Dynamics and results of evolution are unpredictable and
hard to analyze
Genetic Art and Computer Graphics
(Karl Sims, 1993)
• GA individuals: equations that generate a color for each pixel coordinate
• Function set:
+, -, /, mod, round, min, max, abs, expt, log, and, or, xor, sin, cos, atan, if, dissolve, hsv-to-rgb, vector, transform-vector, bw-noise, color-noise, warped-bw-noise, warped-color-noise, blur, band-pass, grade-mag, grad-dir, bump, ifs, warped-ifs, warp-abs, warp-rel, warp-by-grad
• Terminal set: X, Y, rand_scalar(), rand_vector(n)
11
• Each function returns an image (an array of pixel colors)
Left to right, top to
bottom:
a. Y
b. X
c. (abs X)
d. (mod X (abs Y))
e. (and X Y)
f. (bw-noise .2 2)
g. (color-noise .1 2)
h. (grad-direction
(bw-noise .15 2)
0 0)
i. (warped-color-noise
(* X .2) Y .1 2)
12
Some Results
(round (log (+ y (color-grad (round (+ (abs (round (log (+ y (color-grad (round (+ y (log (invert y) 15.5)) x) 3.1 1.86 #(0.95 0.7 0.59) 1.35)) 0.19) x)) (log (invert y) 15.5)) x) 3.1 1.9 #(0.95 0.7 0.35) 1.35)) 0.19) x)
13
14
15
Moviehttp://www.youtube.com/watch?v=8LChmQjR0O0
Demohttp://www.darwinsgaze.com/evolveit.php
MovieEvolving artificial creatures