Genetic%20Algorithms - PowerPoint PPT Presentation

About This Presentation
Title:

Genetic%20Algorithms

Description:

'Although the human mind can create a lot of inventions, it cannot ... How fast an impala must be in order to survive a cheetah hunting? february 19, 2004 ... – PowerPoint PPT presentation

Number of Views:69
Avg rating:3.0/5.0
Slides: 34
Provided by: familiagal
Category:

less

Transcript and Presenter's Notes

Title: Genetic%20Algorithms


1
Genetic Algorithms
  • José Galaviz Casas
  • Facultad de Ciencias
  • UNAM

2
Contents
  • Introduction, motivation, fundamental concepts.
  • How genetic algorithms work.
  • Operators.
  • Theoretical framework.
  • Variations around the same theme

3
Nature as optimizer
  • Although the human mind can create a lot of
    inventions, it cannot create better, more simple
    and direct inventions than nature, since in its
    creations nothing is missing and nothing is
    superfluous. (Leonardo da Vinci, Notebook).
  • Optimal individuals live in very complicated
    environment. Lots of variables (atmospheric
    pressure, temperature, predators, resources,
    chemical substances, etc.)

4
How (we think that) nature works
  • Evolutionary process.
  • Selection of well adapted individuals. The better
    the fitness is, the larger the reproduction
    chance.
  • Searching phenotypes is hard (How can we
    determine the shape, color, physiological and
    functional features of an optimal marine predator
    if we dont know a white shark?)
  • Easiest way searching genotypes. Encoding the
    problem domain.
  • Mutation is evolutions engine.

5
Genetic algorithms
  • Searching methods inspired by natural evolution.
    Let the nature be your guide.
  • John Holland (60s).
  • Originally A model for natural evolution.
  • Now Method for optimization and machine learning.

6
How GA works?
  • Domain encoding.
  • Creation of initial population of codes. Proposed
    solutions for the optimization problem.
  • Evaluation of fitness.
  • Selection of individuals as a function of their
    fitness.
  • Creation of new proposed solutions based on the
    individuals selected.
  • Creation of new proposed solutions based on a
    random alterations of genetic codes.
  • Iteration of whole process.

7
Domain encoding
  • We must know the entire domain of problem
    (phenotypes space).
  • We define an encoding procedure that maps
    phenotypes to codes (genetic code, genotype).
  • Typically this is not an injective function
    (several phenotypes may be mapped to the same
    genotype).
  • We are interested in the inverse mapping.
    Formally this is not a function, but we impose
    restrictions.
  • We hope that actual solution can be obtained from
    some code in the genotypes space. At least we
    want some code(s) to be mapped close enough to
    such solution.

8
Evaluation
  • Fitness function. Maps every possible genotype to
    an aptitude level.
  • Formally a non-negative function. However this is
    violated in practice. Greatest value for better
    individuals.
  • Population relative. How fast an impala must be
    in order to survive a cheetah hunting?

9
Selection
  • Proportional to fitness (simple genetic algorithm
    SGA). But there are other alternatives.
  • Survival of the fittest.

10
New individuals(from selected codes)
  • Given two (or more) selected individuals their
    codes are mixed in order to generate offspring.
  • We manipulate only codes. The genotypes obtained
    correspond to some phenotypes in the problems
    domain, but generally we dont care about that.
  • Sometimes we need to guarantee that hybrid
    individuals are valid phenotypes.

11
New individuals(from random alterations)
  • Some elements in the code of new individuals are
    randomly changed.
  • Generally we dont care about phenotypes.
  • Sometimes we need to restrict the changes in
    order to obtain codes for valid phenotypes.

12
The general procedure
  1. Define the problem domain encoding.
  2. Generate an initial population of codes
    (genotypes). This will be called current
    generation.
  3. Evaluate the fitness of every individual in the
    current generation.
  4. Perform the selection of two individuals in
    current generation.
  5. Determine if the selected individuals must be
    crossed. Random event pc .

13
  1. If selected individuals must be crossed, then
    perform crossover, generate two offspring called
    new individuals.
  2. If selected individuals must not be crossed the
    selected individuals are called new individuals.
  3. For every new individual determine if mutation
    must be performed for every element in its code.
    Random event pm .
  4. Add the two new individuals in the new
    generation.
  5. If new generation has N individuals, call it
    current generation, return to step 3 until some
    convergence criteria has been accomplished.
  6. Else return to step 4.

14
Proportional selection
15
1-point crossover
  • Choose a random cut point in the genetic code of
    every individual.
  • Mix the complementary parts.

16
Example
 
Maximum in xm 7/11 0.6363... Not in genotypes
space!
17
 
 
18
Why GA works?
  • We suppose individuals are encoded as binary
    strings.
  • Schema pattern, template accomplished by several
    codewords.
  • Example 010010110 and 111010010 are instances of
    schema 101010, also are instances of
    1, 100, etc.
  • Defining length ?(H) distance between first and
    last defined position in the schema. 7 in the
    example.
  • Order o(H) number of defined positions in the
    schema. 6 in the example.

19
The first model
  • Let m(H, t) be the number of instances of schema
    H in the t-th generation of a simple genetic
    algorithm.
  • We assume
  • proportional selection
  • 1-point crossover P(breaking H) ?(H)/(l-1)
    where l is the string length.
  • uniform mutation P(survival H) ? 1- o(H) pm

20
The schema theorem
  • The expected number of instances of schema H in
    generation at time t1

21
Not very useful
  • Only disruptive effects of genetic operators are
    considered.
  • Only a lower bound, not very tight. Long time
    behavior is not accurately predicted.
  • Very particular.

22
Other kinds of crossover
2-point crossover
Uniform crossover
23
Some crossover operators
24
The building block hypothesis
  • Since the schemas survive easily if
  • They are short
  • They are good (high fitness)
  • Therefore the solutions obtained by the GA must
    be constructed using schemas with these
    characteristics, building blocks.
  • Contradictory evidence (hitchhicking).

25
Implicit parallelism
  • Every binary string of length l is instance of 2l
    schemas.
  • Evaluation of one string is the implicit
    evaluation of a sample of exponentially many
    schemas.

26
Exploitation Vs. exploration
  • There are two opposite forces working in a GA.
  • Selection pressure. Exploitation of acquired
    knowledge.
  • Mutation. Random exploration of search space.
  • Selection causes convergence, even to a
    sub-optimal solution. Gravity.
  • Mutation favors finding of optimal solution, but
    causes divergence. Expansive pressure.
  • Trade-off emphasizing one of them diminishes the
    other. Impact in performance and/or robustness.

27
Two armed bandit
  • Bandit machine, two arms, the payoff of each arm
    is a normally distributed random variable. The
    mean of one of the arms is higher, but we doesnt
    know which one.
  • We have a limited amount of money for exploration
    and exploitation, simultaneously.
  • How the sampling must be performed?
  • Answer the arm with the current best observed
    mean must receive exponentially many more
    experiments than the other one.

28
GAs and the bandit
  • If we consider proportional selection only.
  • Let H be a schema with above average fitness
  • The schema theorem says

29
The building blocks hypo
  • Mitchell-Holland-Forrest, 1994. Royal Roads.
  • Functions created ad-hoc to support the BBH.
  • Genetic algorithm carefully adapted to prevent
    premature convergence.
  • Three hillclimbers for comparison purposes. SAHC,
    NAHC, RMHC.
  • RMHC outperforms GA. Oops!
  • Spurious correlation (hitchhicking).

30
The idealized GA (IGA)
  • Works on single strings, not population.
  • Always preserve the best code found.
  • Chooses new individual randomly, if such
    individual is better than the current best
    individual, cross them.

31
How can we reach the desired IGA?
  • Can be approximated by a GA if
  • There are no locus with fixed value in high
    proportion of population.
  • Good schemas must be favored by strong enough
    selection, but also hitchhicking must be avoided.
  • Crossover probability must be high enough to
    guarantee that good schemas have enough diffusion
    in population.

32
Alternative GAs
  • Elitism. Important feature. It has been proved
    that elitism is the sufficient condition for
    convergence to the optimal.
  • Deterministic selection schemes. In a population
    sorted decreasingly by fitness
  • Nietzsche. The i-th individual is crossed with
    the (i1)-th.
  • Vasconcelos. The i-th individual is crossed with
    the (N-i)-th. Good approximation to IGA. Has been
    statistically proved (Kuri, 2002) that
    GA(Vasconcelos)elitism achieve best performance.
  • Self-adaptation. The control parameters such pm
    and pc, are encoded in the individuals.
  • AGhillclimbers or AGcatastrophic events.
  • Co evolution.

33
Variations
  • Several encoding schemes binary (Gray, weighted
    positional, etc.), non-binary.
  • Ad-hoc operators problem-dependent. Panmictic
    (orgiastic) crossover operators.
  • Knowledge-based biased initial population.
  • Several selection schemes fitness based
    (proportional, sigma truncation), tournament,
    ranking (linear, non-linear).
  • Additional features. Imagination is the limit.
Write a Comment
User Comments (0)
About PowerShow.com