1 / 77

Machine Learning Evolutionary Algorithms

Machine Learning Evolutionary Algorithms. You are here. What is Evolutionary Computation?. An abstraction from the theory of biological evolution that is used to create optimization procedures or methodologies, usually implemented on computers, that are used to solve problems.

samueln
Download Presentation

Machine Learning Evolutionary Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Machine LearningEvolutionary Algorithms

  2. You are here

  3. What is Evolutionary Computation? An abstraction from the theory of biological evolution that is used to create optimization procedures or methodologies, usually implemented on computers, that are used to solve problems.

  4. Brief History : the ancestors • 1948, Turing: proposes “genetical or evolutionary search” • 1962, Bremermann optimization through evolution and recombination • 1964, Rechenberg introduces evolution strategies • 1965, L. Fogel, Owens and Walsh introduce evolutionary programming • 1975, Holland introduces genetic algorithms • 1992, Koza introduces genetic programming

  5. Darwinian EvolutionSurvival of the fittest • All environments have finite resources (i.e., can only support a limited number of individuals) • Life forms have basic instinct/ lifecycles geared towards reproduction • Therefore some kind of selection is inevitable • Those individuals that compete for the resources most effectively have increased chance of reproduction • Note: fitness in natural evolution is a derived, secondary measure, i.e., we (humans) assign a high fitness to individuals with many offspring

  6. Darwinian Evolution:Summary • Population consists of diverseset of individuals • Combinations of traits that are better adapted tend to increase representation in population Individuals are “units of selection” • Variations occur through random changes yielding constant source of diversity, coupled with selection means that: Population is the “unit of evolution” • Note the absence of “guiding force”

  7. The Concept of Natural Selection • Limited number of resources • Competition results in struggle for existence • Success depends on fitness -- • fitness of an individual: how well-adapted an individual is to their environment. This is determined by their genes (blueprints for their physical and other characteristics). • Successful individuals are able to reproduce and pass on their genes

  8. Crossing-over • Chromosome pairs align and duplicate • Inner pairs link at a centromere and swap parts of themselves • After crossing-over one of each pair goes into each gamete

  9. Recombination (Crossing-Over) Image from http://esg-www.mit.edu:8001/bio/mg/meiosis.html

  10. Sperm cell from Father Egg cell from Mother New person cell (zygote) Fertilisation

  11. Mutation • Occasionally some of the genetic material changes very slightly during this process (replication error) • This means that the child might have genetic material information not inherited from either parent • This can be • catastrophic: offspring in not viable (most likely) • neutral: new feature not influences fitness • advantageous: strong new feature occurs • Redundancy in the genetic code forms a good way of error checking

  12. Genetic code • All proteins in life on earth are composed of sequences built from 20 different amino acids • DNA is built from four nucleotides in a double helix spiral: purines A,G; pyrimidines T,C • Triplets of these from codons, each of which codes for a specific amino acid • Much redundancy: • purines complement pyrimidines • the DNA contains much rubbish • 43=64 codons code for 20 amino acids • genetic code = the mapping from codons to amino acids • For all natural life on earth,the genetic code is the same !

  13. Motivations for Evolutionary Computation • The best problem solver known in nature is: • the (human) brain that created “the wheel, New York, wars and so on” (after Douglas Adams’ Hitch-Hikers Guide) • the evolution mechanism that created the human brain (after Darwin’s Origin of Species) • Answer 1  neurocomputing • Answer 2  evolutionary computing

  14. Problem type 1 : Optimisation • We have a model of our system and seek inputs that give us a specified goal • e.g. • time tables for university, call center, or hospital • design specifications, etc etc

  15. EC • A population of individuals exists in an environment with limited resources • Competition for those resources causes selection of those fitter individuals that are better adapted to the environment • These individuals act as seeds for the generation of new individuals through recombination and mutation • The new individuals have their fitness evaluated and compete (possibly also with parents) for survival. • Over time Natural selection causes a rise in the fitness of the population

  16. General Scheme of EC

  17. Pseudo-code for typical EA

  18. What are the different types of EAs • Historically different flavours of EAs have been associated with different representations: • Binary strings : Genetic Algorithms • Real-valued vectors : Evolution Strategies • Trees: Genetic Programming • Finite state Machines: Evolutionary Programming

  19. Evolutionary Algorithms • Parameters of EAs may differ from one type to another. Main parameters: • Population size • Maximum number of generations • Selection factor • Mutation rate • Cross-over rate • There are six main characteristics of EAs • Representation • Selection • Recombination • Mutation • Fitness Function • Survivor Decision

  20. Example: Discrete Representation (Binary alphabet) • Representation of an individual can be using discrete values (binary, integer, or any other system with a discrete set of values). • Following is an example of binary representation. CHROMOSOME GENE

  21. Evaluation (Fitness) Function • Represents the requirements that the population should adapt to • Called also quality function or objective function • Assigns a single real-valued fitness to each phenotype which forms the basis for selection • So the more discrimination (different values) the better • Typically we talk about fitness being maximised • Some problems may be best posed as minimisation problems

  22. Population • Holds (representations of) possible solutions • Usually has a fixed size and is a multiset of genotypes • Some sophisticated EAs also assert a spatial structure on the population e.g., a grid. • Selection operators usually take whole population into account i.e., reproductive probabilities are relative to current generation

  23. Parent Selection Mechanism • Assigns variable probabilities of individuals acting as parents depending on their fitness • Usually probabilistic • high quality solutions more likely to become parents than low quality but not guaranteed even worst in current population usually has non-zero probability of becoming a parent

  24. Mutation • Acts on one genotype and delivers another Element of randomness is essential and differentiates it from other unary heuristic operators • May guarantee connectedness of search space and hence convergence proofs

  25. Recombination • Merges information from parents into offspring • Choice of what information to merge is stochastic • Most offspring may be worse, or the same as the parents • Hope is that some are better by combining elements of genotypes that lead to good traits

  26. Survivor Selection • replacement • Most EAs use fixed population size so need a way of going from (parents + offspring) to next generation • Often deterministic • Fitness based : e.g., rank parents+offspring and take best • Age based: make as many offspring as parents and delete all parents • Sometimes do combination

  27. Example: Fitness proportionate selection • Expected number of times fi is selected for mating is: • Better (fitter) individuals have: • more space • more chances to be selected Best Worst

  28. Example: Tournament selection • Select krandom individuals, without replacement • Take the best • k is called the size of the tournament

  29. Example: Ranked based selection • Individuals are sorted on their fitness value from best to worse. The place in this sorted list is called rank. • Instead of using the fitness value of an individual, the rank is used by a function to select individuals from this sorted list. The function is biased towards individuals with a high rank (= good fitness).

  30. Example: Ranked based selection • Fitness: f(A) = 5, f(B) = 2, f(C) = 19 • Rank: r(A) = 2, r(B) = 3, r(C) = 1 • Function: h(A) = 3, h(B) = 5, h(C) = 1 • Proportion on the roulette wheel: p(A) = 11.1%, p(B) = 33.3%, p(C) = 55.6% *skip*

  31. Initialisation / Termination • Initialisation usually done at random, • Need to ensure even spread and mixture of possible allele values • Can include existing solutions, or use problem-specific heuristics, to “seed” the population • Termination condition checked every generation • Reaching some (known/hoped for) fitness • Reaching some maximum allowed number of generations • Reaching some minimum level of diversity • Reaching some specified number of generations without fitness improvement

  32. Algorithm performance • Never draw any conclusion from a single run • use statistical measures (averages, medians) • from a sufficient number of independent runs • From the application point of view • design perspective: find a very good solution at least once • production perspective: find a good solution at almost every run

  33. Genetic Algorithms

  34. GA Overview • Developed: USA in the 1970’s • Early names: J. Holland, K. DeJong, D. Goldberg • Typically applied to: • discrete optimization • Attributed features: • not too fast • good heuristic for combinatorial problems • Special Features: • Traditionally emphasizes combining information from good parents (crossover) • many variants, e.g., reproduction models, operators

  35. Genetic algorithms • Holland’s original GA is now known as the simple genetic algorithm (SGA) • Other GAs use different: • Representations • Mutations • Crossovers • Selection mechanisms

  36. SGA technical summary tableau

  37. Select parents for the mating pool (size of mating pool = population size) • Shuffle the mating pool • For each consecutive pair apply crossover with probability pc , otherwise copy parents • For each offspring apply mutation (bit-flip with probability pm independently for each bit) • Replace the whole population with the resulting offspring SGA reproduction cycle

  38. SGA operators: 1-point crossover • Choose a random point on the two parents • Split parents at this crossover point • Create children by exchanging tails • Pc typically in range (0.6, 0.9)

  39. SGA operators: mutation • Alter each gene independently with a probability pm • pm is called the mutation rate • Typically between 1/pop_size and 1/ chromosome_length

  40. 1/6 = 17% B fitness(A) = 3 A C fitness(B) = 1 2/6 = 33% 3/6 = 50% fitness(C) = 2 SGA operators: Selection • Main idea: better individuals get higher chance • Chances proportional to fitness • Implementation: roulette wheel technique • Assign to each individual a part of the roulette wheel • Spin the wheel n times to select n individuals

  41. An example • Simple problem: max x2 over {0,1,…,31} • GA approach: • Representation: binary code, e.g. 01101  13 • Population size: 4 • 1-point xover, bitwise mutation • Roulette wheel selection • Random initialisation • We show one generational cycle done by hand

  42. x2 example: selection

  43. X2 example: crossover

  44. X2 example: mutation

  45. The simple GA • Shows many shortcomings, e.g. • Representation is too restrictive • Mutation & crossovers only applicable for bit-string & integer representations • Selection mechanism sensitive for converging populations with close fitness values • Generational population model (step 5 in SGA repr. cycle) can be improved with explicit survivor selection

  46. Two-point Crossover • Two points are chosen in the strings • The material falling between the two points • is swapped in the string for the two offspring • Example:

  47. n-point crossover • Choose n random crossover points • Split along those points • Glue parts, alternating between parents • Generalisation of 1 point (still some positional bias)

  48. Uniform crossover • Assign 'heads' to one parent, 'tails' to the other • Flip a coin for each gene of the first child • Make an inverse copy of the gene for the second child • Inheritance is independent of position

  49. Cycle crossover example • Step 1: identify cycles • Step 2: copy alternate cycles into offspring

  50. Crossover OR mutation? Exploration: Discovering promising areas in the search space, i.e. gaining information on the problem Exploitation: Optimising within a promising area, i.e. using information There is co-operation AND competition between them • Crossover is explorative, it makes a big jump to an area somewhere “in between” two (parent) areas • Mutation is exploitative, it creates random small diversions, thereby staying near (in the area of ) the parent

More Related