2015/10/221 genetic algorithm. 2 outline evolutionary computation genetic algorithms genetic...

32
111/03/23 1 Genetic Algorithm

Upload: lily-moody

Post on 02-Jan-2016

225 views

Category:

Documents


2 download

TRANSCRIPT

  • ** Genetic Algorithm

  • *Outline

    Evolutionary ComputationGenetic algorithmsGenetic Programming

  • *(Charles Darwin)1809/02/12(1859) (Natural selection)

  • *Evolution Strategies

    2050RechenbegandSchwefel(1965) Evolution Strategies 1965Rechenbergand Schwefel(the Technical University of Berlin)Evolution Strategies

    Rechenberg

    mutate

  • *Genetic Algorithm

    J. H. HollandUniversity of Michigan1967J.H.Holland""19681975Adaptation in Nature and Artificial System ( (Crossover)

  • *

    Evolutionary ProgrammingProposed by L. J. Fogelin 1966 and refined by his son D.B. Fogelin 1991The goal of EP is to achieve intelligent behaviorthrough simulated evolutionL. FogelGenetic Programming Proposed by J. R. Koza in 1992Genetic Algorithms, Genetic Programming, Evolution Strategies, and Evolutionary Programming Evolutionary Computation

  • *Evolutionary Algorithms

    Evolutionary AlgorithmsGenetic Algorithms (GA)

    Genetic Programming (GP)

    Evolution Strategies (ES)

    Evolutionary Programming (EP)

  • *Problem solution using evolutionary algorithmsCoding of solutionsObjective functionGenetic operatorsSpecific knowledgeproblemGenetic searchGenetic searchsolutionselectionreplicationRecombination crossovermutation Fitnessassignment

  • *ESEPgenerationgenerationselectionreproductionGenetic operators

  • * Simple Genetic Algorithm() { Initialize population; evaluate population; while (termination criterion not reached) { select solutions for next population (reproduction); perform crossover and mutation; evaluate population; }}

    GAs

  • *Basics of GAsA genetic algorithm is a search procedure based on the mechanics of natural selection and genetics.Algorithm starts with a set of solutions (represented by chromosomes) called population. Solutions from one population are taken and used to form a new population.This is motivated by a hope, that the new population will be better than the old one. Solutions which are selected to form new solutions (offspring) are selected according to their fitness - the more suitable they are, the more chances they are reproduced. This is repeated until some condition (for example number of populations or improvement of the best solution) is satisfied. Require two things Survival-of-the-fittest Variation

  • *

  • *2 important genetic operatorsCrossoverMutation

  • *Single point crossover0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|01|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0|0|1|1|1|1|1|1|1|1|1|1|1|1|11|1|10|0|0Drawback: position biasGene in loci 1 and 2 often Crossover togetherparentchildren

  • *1|1|1|1|1Multipoint crossover0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|01|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1parent||0|0|0|0|0||1|1|1|1|1|1|1|1|10|0|0|00|0|0|0|0|0|01|1children

  • *Uniform crossover0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|01|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1parent0|1|0|0|1|1|0|0|1|0|1|1|0|0|1|0each parent 50% children1|0|1|1|0|0|1|1|0|1|0|0|1|1|0|1Inverse of the other child

  • *Point mutate0|1|0|0|1|1|0|0|1|0|1|1|0|0|1|0parent0|1|0|0|1|1|0|0|1|0|1|0|0|0|1|0child

  • *Crossover for real-valued variablesThe original GA was designed for binary-encoded data

    (x1, x2, , xn)(y1, y2,,yn)(x1,x2,,yk+(1-)xk,,xn)(y1,y2,,xk+(1-)yk,,yn)Ex: (0.5,1.0,1.5,2.0) (0.2,0.7, 0.2, 0.7)=0.4At 3nd gene(0.5,1.0,(0.4)(0.2)+(0.6)(1.5), 2.0)(0.5,1.0,0.98,2.0)(0.2,0.7,(0.4)(1.5)+(0.6)(0.2),0.7)(0.2,0.7,0.72,0.7)Single arithmetic crossover

  • *Simple arithmetic crossover(x1, x2, , xn)(y1, y2,,yn)(x1, x2,, yk+(1- )xk,, yn+(1- )xn)(y1, y2, , xk+(1- )yk,, xn+(1- )yn)

  • *Discrete Crossover: each gene is chosen with uniform probability to be the gene of one or the other of the parents chromosomesParents : (0.5, 1.0, 1.5,2.0), (0.2,0.7, 0.2, 0.7)Child: (0.2, 0.7, 1.5, 0.7)

  • *Normally distributed mutationRandom shock may be added to each variable. The shock Should be normally distributed N(0,)Suppose the shock is N(=0, =0.1)Pm =1, each variable is mutatedShock are 0.05, -0.17, -0.03, 0.08Chromosome (0.2,0.7,1.5, 0.7) is mutated to (0.2+0.05, 0.7-0.17, 1.5-0.03, 0.7+0.08)= (0.25, 0.53, 1.47, 0.78)

  • *A simple GA at workEncode Encode solutions to a problem as a set of numbers. Define a Fitness Metric This is a number that defines a solution's goodness. Evolve Improve the population by a process of Darwinian selection favoring the reproduction of fitter solutions. Initialize population by randomly generating N genomes. Evaluate fitness of all the individuals in the population. Repeat this loop until the solutions are adequate.

  • *Find the maximum of N(=16,=4)x=16f(x)x481216202428Init: pc=0.75, pm=0.002Representation: n=4 l=500000-11111(0)(31)

  • *4 init. chromosomes00100 (4), 01001(9), 11011(27) and 11111(31)Fitness fu. = f(x)

  • *chromosomeDecimal valuefitnessSelection probability0010040.0011080.04425 0100190.0215690.8614511011270.0022730.0907811111310.0000880.00351

  • *selection : 01001, 11011 are selectedCrossover: at the second bit0 1 0 0 11 1 0 1 10 1 0 1 11 1 0 0 1parentchildren1125No mutate this time

  • *selection : 01001, 00100 are selectedNo crossover this timeNew population: 00100, 01001, 01011(11), 1100111 is a closer to 16!

  • *chromosomeDecimal valuefitnessSelection probability0010040.0011080.014527 0100190.0215690.28278301011110.0456620.59865711001250.0000880.104003

  • *selectionAt 1st generation, 01001(9) dominated the fitness measure (86%), it will be selected too many times, generates too many copies, which impairs GA search capability (easy to stuck at local optimum)---crowding phenomenonVariability vs fitness

  • *Selection (contd)Boltzmann selectionT: temperature, from high to lowAt the beginning, fitness bias is suppressed, sovariability is high, the search space is large At the end, fitness bias is enlarged, so global optimum is found quickly.

  • *Elitism: requires Gas to retain a certain number of the fittest chromosomes.Ranking: ranks the chromosomes according to their fitness, reduces crowding problem, but low variabilityEtc.

  • *Advantages of GA

    GAs can search spaces of hypotheses containing complex interacting parts, where the impact of each part on overall hypothesis fitness may be difficult to modelGAs are easily parallelized and can take advantage of the decreasing costs of powerful computer hardware