Top Banner
Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option
36

Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Mar 26, 2015

Download

Documents

Michelle Wagner
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Evolutionary Algorithms

Nicolas Kruchten4th Year Engineering Science

Infrastructure Option

Page 2: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

What are they?

• EAs are stochastic techniques used to search multidimensional spaces for points, according to some criteria.

• They operate by mimicking reproduction & selection processes

• More on this in a bit…

Page 3: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

What are they good for?

• EAs are used to solve optimization problems of various types:

Find the vector x such that f(x) is min or max

• A huge variety of engineering or science problems can be reduced to, or expressed as, optimization problems

Page 4: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

A black-box example

• Say you have a black box, with n knobs, and a light bulb, what set of knob positions will make the bulb glow brightest?

Page 5: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

What if…

• n=1? n=10000?

• knobs are continuous? discrete? mixed?

• some combinations are invalid? (i.e. knob 1 must be less than knob 2)

• an analytical expression exists?

Page 6: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Traditional methods

• Direct Calculus

• Gradient descent or hill climbing

• Frank Wolfe (!)

• Simplex

• Simulated Annealing

• SPSA

• Etc.

Page 7: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Unfortunately they…

• Sometimes simply don’t apply

• Only work for specific problems

• Don’t scale well (NP-Hard, NP-Complete)

• Get ‘trapped’ in local optima

Page 8: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

EAs…

• Don’t have all of these problems

• Scale reasonably well

• Work for a huge variety of problems

• Don’t require gradients but can use them

Page 9: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

How EAs work

1) Pick a ‘population’ of feasible points

2) Generate new points from the better ones

3) Throw out the worse ones

4) That’s one ‘generation’: rinse & repeat

• Lo and behold! The points in your population are getting better and better!

Page 10: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Back to our example

• Our feasible points were sets of knob positions, we call these ‘chromosomes’

• Individual knob positions are ‘genes’

• The brightness we call the ‘fitness’, we’re looking for chromosomes with good fitness

Page 11: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

How to get new points

• This is where the ‘genetic’ comes in

• Given some ‘parent’ chromosomes, how do we mix them up and get a ‘child’?

• Various schemes are possible depending on how we represent the parents (binary, real, integer etc)

Page 12: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Mutation

• If we only ever blend or mix and match genes, we can only ever explore combinations of our initial gene pool

• To explore new parts and find new optima, we periodically change, or mutate, genes.

• Again, various processes are possible.

Page 13: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Which parents to use

• Various schemes exist for selection:– Pick the best ones– Pick random ones– Pick them based on relative fitness– Pick them based on relative rank– Pick them based on how different they are– etc

Page 14: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Which points to keep

• Various schemes exist to decide which children and/or parents to keep at each generation– Keep only the children– Select from a pool of children and parents

• Best• Random• Rank• Fitness, etc

Page 15: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

When to stop

• You can stop an EA whenever is appropriate, but typical convergence criteria include:– A number of generations– A given standard deviation of fitnesses– A period of time– Total convergence– Etc.

Page 16: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Putting it all togetherLet t = 0;

Initialize P(t)

Evaluate C(t)

Let t = t + 1;Assemble P(t)

from P(t-1) and C(t-1)

Stop?no

End

yes

Evaluate P(t)

Generate C(t) from P(t)

Page 17: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

EA Limitations

• EAs are extremely flexible, but they have their own problems:

– Can be very slow, requiring many potentially long evaluations

– Are tough to design and configure, many many parameters

– No guarantee of global optimum

Page 18: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Some history

• You may have heard of GAs, which are a subset of EAs

• Much confusion and conflicting terminology exists

• A huge body of operators, combinations and approaches have been proposed

Page 19: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Evolutionary Programming

• Traditional:– Credited to Fogel, US, published in 66– Single parents (so not genetic)– Basically pure mutation

• Since then:– EP approaches themselves mutated

independently towards general EA practice

Page 20: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Evolutionary Strategies

• Traditional:– Credited to Rechenberg and Schwefel,

Switzerland, published in 73– Tiny populations (1 or 2)– Sophisticated adaptive mutation scheme

• Since then:– Adaptive mutation has gone mainstream

Page 21: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Genetic Algorithms

• Traditional:– Credited to Holland, US, published in 72– Binary coding– Keep only the children

• Since then:– Has grown to be loosely interchangable with

EA, with real-coded GA, crowding GA etc

Page 22: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

State of the art

• No hard and fast rules about the best EA flavour for a given problem

• Some heuristics exist

• EAs have been successfully applied to many problems in various fields, but with few general results

Page 23: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

Advanced EAs

• Parallelization

• Distribution– Master/Slave– Peered Demes (see parallelization)– Hybrid

• Hybridization

Page 24: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

ITS Applications

• Model calibration is a great example of a challenging transportation-related optimization:

Minimize an error term byvarying some model parameters

Page 25: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

ITS Example: GAID

• Genetic Adaptive Incident Detection

• Use of a GA to train a neural network: perfect example of ANN + EA = ITS

• The problem: automatically detecting incidents on the freeway, using traffic loop data

Page 26: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

GAID: Basics

• GAID uses a probabilistic neural network (PNN) which takes 16d vectors and classifies them into two piles

• Traffic loop data -> incident/normal

• The PNN is defined by 16 parameters

Page 27: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

GAID: Diagram

PNN = f(parameters)Loop Data

Incident

Normal

16Parameters

EA

Page 28: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

GAID: Fitness

• Fitness: correct classifications/number of vectors

• We ‘quiz’ the PNN with known data to score it

• We are looking for the set of 16 real parameters which make GAID the most accurate

Page 29: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

GAID: Initialization

• Initialization:– Pick population size: 50– Pick 50 random sets of 16 real parameters

between 0 and 1000– Score the chromosomes

Page 30: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

GAID: Generation

• Generation:– Pick the child population (generation) size: 50– Select 2 parents at random– Each child gene is either mom or dad’s– Mutate every gene: add some uniformly

distributed random number between -50 and 50

– Score the children

Page 31: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

GAID: 2d view

Page 32: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

GAID: 2d view

Page 33: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

GAID: 2d view

Page 34: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

One alternative

Page 35: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

GAID: Assembly

• Assembly of children and parents:

– Choose the 50 best from the combined pool of children and parents

• Convergence: repeat, stopping when the STD is less than 0.005

Page 36: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.

GAID: Summary

• Real representation, 16 genes• Popsize = Gensize = 50• Random Initialization• 2 parents, random selection• real crossover, creep mutation on all

genes• Crowding assembly, best selection• STD convergence