Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Evolutionary Algorithms Lecture 2 Jim Smith University of the West of England, UK May/June 2012.

Similar presentations


Presentation on theme: "Introduction to Evolutionary Algorithms Lecture 2 Jim Smith University of the West of England, UK May/June 2012."— Presentation transcript:

1 Introduction to Evolutionary Algorithms Lecture 2 Jim Smith University of the West of England, UK May/June 2012

2 Recap of EC metaphor Recap of basic behaviour Role of fitness function Dealing with constraints Representation as key to problem solving – Integer Representations – Permutation Representations – Continuous Representations – Tree-based Representations 2 Overview

3 Recap of EC metaphor 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 3

4 General Scheme of EAs 4

5 Typical behaviour of an EA Early phase: quasi-random population distribution Mid-phase: population arranged around/on hills Late phase: population concentrated on high hills Phases in optimising on a 1-dimensional fitness landscape

6 Typical run: progression of fitness Typical run of an EA shows so-called anytime behavior Best fitness in population Time (number of generations)

7 Best fitness in population Time (number of generations) Progress in 1 st half Progress in 2 nd half Are long runs beneficial? Answer: - how much do you want the last bit of progress? - it may be better to do more shorter runs

8 Evolutionary Algorithms in Context There are many views on the use of EAs as robust problem solving tools. For most problems a problem-specific tool may: – perform better than a generic search algorithm on most instances, – have limited utility, – not do well on all instances Goal is to provide robust tools that provide: – evenly good performance – over a range of problems and instances

9 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 – Finite state Machines: Evolutionary Programming – LISP trees: Genetic Programming These differences are largely irrelevant, best strategy – choose representation to suit problem – choose variation operators to suit representation Selection operators only use fitness and so are independent of representation 9

10 The more fitness levels you have available, the more information is potentially available to guide search EAs can cope with fitness functions that are: – Noisy, – Time dependant, – Discontinuous – and have Multiple optima, 10 Role of fitness function

11 Constrained Optimisation Problems – Some problems inherently have constraints as well a fitness functions – Can incorporate into fitness functions (indirect) – Can also incorporate into representation (direct) Constraint Satisfaction Problems – Seek solution which meets set of constraints – Transform to COP by minimising constraints (indirect method), – Might be able to use good representations (direct) 11 Problems with Constraints

12 Feasible & Unfeasible Regions Space will be split into two disjoint sets of spaces: – F (the feasible regions) –may be connected – U (the unfeasible regions). S X U F n s

13 Methods for constraint handling DirectIndirect

14 Indirect (Penalty Functions)Direct Conceptually simple, transparentit works well reduces problem to simple optimizationexcept simply eliminating all infeasible solutions Prosallows user to tune to his/her preferences by weights allows EA to tune fitness function by modifying weights during the search problem independent Consloss of info by packing everything in a single number problem specific said not to work well for sparse problems no guidelines 14 Direct vs Indirect Handling

15 Place N queens on a chess board so they cannot take each other 15 Example: N Queens 64*63*62*61*60 *59*58*56 solutions for N=8 =64!/ (56! * 8!) = 4.4 * 10 9

16 Fitness function: N – num_vulnerable_queens – Transforms CSP to COP Population and Selection? – Whatever we like, e.g: – Population size100, – tournament selection of 2 parents – Replace two least fit from population if better Representation? 16 Designing an EA

17 Method 1: Based on the board – 64-bit Binary string: 0/1 empty /occupied – 2 64 possibilities –more than problem! – Introduces extra constraint that only 8 cells occupied – Repair function or specialised operators? – Or fractional penalty function Based on the pieces – More natural and problem focussed – Avoids extra constraint 17 Possible Representations

18 Binary Recombination – One point, N-point – Uniform Randomly choose parent 1 or 2 for each gene Mutation – Independent flip 0 1 for each gene 18 Operators for binary representations

19 Label cells 1-64 Method 2: one gene per piece encodes cell – 64 N = for 1.7 x for N=8 (potential duplicates) – 1pt crossover, extended random mutation – Ok, but huge space with only 9 fitness levels Could make think about constraints – Rows, columns, diagonals – Indirect – penalise all – Direct – can we avoid some? 19 Integer Representations

20 Integer representations Some problems naturally have integer variables, e.g. image processing parameters Others take categorical values from a fixed set e.g. {blue, green, yellow, pink} N-point / uniform crossover operators work Extend bit-flipping mutation to make – creep i.e. more likely to move to similar value – Random choice (esp. categorical variables) – For ordinal problems, it is hard to know correct range for creep, so often use two mutation operators in tandem 20

21 Method 3 – Row constraint each queen on different row – Let value off gene I = column of queen in row I – Solution space size 8 N = 1.67x10 7 – One point crossover, extended randomised mutation Method 4 – As above but also meet column constraints – Permutation: N! = – Now need specialised crossover and mutation 21 Partially direct representations

22 Permutation Representations Ordering/sequencing problems form a special type. Solution= arrangement objects in a certain order. – Example: sort algorithm: important thing is which elements occur before others (order), – Example: Travelling Salesman Problem (TSP) : important thing is which elements occur next to each other (adjacency), These problems are generally expressed as a permutation: – if there are n variables then the representation is as a list of n integers, each of which occurs exactly once 22

23 Variation operators for permutations Normal mutation operators dont work: – e.g. bit-wise mutation : let gene i have value j – changing to some other value k would mean that k occurred twice and j no longer occurred Therefore must change at least two values Various mechanisms exist (swap, invert,...). Similar arguments mean specialised crossovers are needed. 23

24 24 Example mutation operators

25 Normal crossover operators will often lead to inadmissible solutions Many specialised operators have been devised which focus on combining order or adjacency information from the two parents Crossover operators for permutations

26 Many successful Machine Learning / Data Mining algorithms use greedy search: – Decision trees add most informative nodes – Rule Induction: add most useful next rule – Bayesian networks: to identify co-related features Distance-based methods measure difference along each axis All these can be improved by using global search in the feature selection process Use a binary coded GA: 0/1 : use/dont use feature – M. Tahir and J.E. Smith. Creating Diverse Nearest Neighbour Ensembles using Simultaneous Metaheuristic Feature Selection Pattern Recognition Letters, 31(11): – Smith, M. & Bull, L. (2005) Genetic Programming with a Genetic Algorithm for Feature Construction and Selection. Genetic Programming and Evolvable Machines 6(3): Another Example of Binary Encoding: Feature Selection for Machine Learning

27 Binary string representing choice of features Full Data SetReduced Data Set Machine Learning Algorithm builds and evaluates model on reduced data Fitness = accuracy EA 27 Schemata for Feature Selection

28 Protein Structure Prediction: – Proteins are created as strings of amino acid residues – Behaviour of a protein is determined by its 3-D structure – Proteins naturally fold to lowest energy structure Model as a fixed-length path through a 3D grid – Representation: sequence of up/down/L/R/forward to specify a path – Fitness based on pairwise interactions between residues N. Krasnogor and W. Hart and J.E. Smith and D. Pelta. Protein Structure Prediction With Evolutionary Algorithms. Proc. GECCO 1999, pages Morgan Kaufmann. R. Santana, P. Larrañaga, and J. A. Lozano. Protein folding in simplified models with estimation of distribution algorithms. IEEE Transactions on Evolutionary Computation. Vol. 12. No. 4. Pp Example of Integer Encoding

29 29 Example of 2D HP model Dark boxes represent hydrophobic residues (H): H-H contacts add +1 to fitness

30 Need to drive processor into a variety of states – to make sure it does the right thing in each. – Test = sequence of assembly code instructions – Traditional methods generate millions of random tests, werent reaching all states UWE solution: evolve sequences of tests – Integer encoding (fixed number of instructions) – Specialised mutation: group instruction in classes, more likely to move to similar type of instruction – J.E. Smith and M. Bartley and T.C. Fogarty. Microprocessor Design Verification by Two-Phase Evolution of Variable Length Tests. Proc IEEE Conference on Evolutionary Computation, pages IEEE Press 30 Example 2: Microprocessor Design Verification

31 Fitness function should provide as much information as possible – Could penalise infeasible solutions – Selection / Population management is independent of representation Representation should suit the problem – Can take constraints into account (direct) – Recombination/Mutation defined by representation – Could be problem specific (direct constraint handling) 31 Summary


Download ppt "Introduction to Evolutionary Algorithms Lecture 2 Jim Smith University of the West of England, UK May/June 2012."

Similar presentations


Ads by Google