Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.
-
Upload
michelle-wagner -
Category
Documents
-
view
215 -
download
2
Transcript of Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.
![Page 1: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/1.jpg)
Evolutionary Algorithms
Nicolas Kruchten4th Year Engineering Science
Infrastructure Option
![Page 2: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/2.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/3.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/4.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/5.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/6.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/7.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/8.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/9.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/10.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/11.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/12.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/13.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/14.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/15.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/16.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/17.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/18.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/19.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/20.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/21.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/22.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/23.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/24.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/25.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/26.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/27.jpg)
GAID: Diagram
PNN = f(parameters)Loop Data
Incident
Normal
16Parameters
EA
![Page 28: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/28.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/29.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/30.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/31.jpg)
GAID: 2d view
![Page 32: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/32.jpg)
GAID: 2d view
![Page 33: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/33.jpg)
GAID: 2d view
![Page 34: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/34.jpg)
One alternative
![Page 35: Evolutionary Algorithms Nicolas Kruchten 4 th Year Engineering Science Infrastructure Option.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/35.jpg)
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.](https://reader034.fdocuments.us/reader034/viewer/2022051819/5513e5a75503466f748b56af/html5/thumbnails/36.jpg)
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