andrew cannon yuki osada angeline honggowarsito€¦ · knapsack, trading prediction in stock...

39
Andrew Cannon Yuki Osada Angeline Honggowarsito

Upload: others

Post on 01-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Andrew CannonYuki Osada

Angeline Honggowarsito

Page 2: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

ContentsWhat are Evolutionary Algorithms (EAs)?Why are EAs Important?Categories of EAsMutationSelf AdaptationRecombinationSelectionApplication

Page 3: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Evolutionary AlgorithmsSearch methods that mimic the process of natural 

evolution

Principle of “Survival of the Fittest”

In each generation, select the fittest parents

Re‐combine those parents to produce new 

offspring

Perform mutations on the new offspring

Page 4: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Why are EAs Important?Flexibility

Adaptable Concept to Problems

Problem examples: Travelling Salesman, 

Knapsack, Trading Prediction in Stock Market, 

etc.

Algorithms to solve those problems are either too 

specialised or too generalised

Page 5: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Categories of EAsGenetic Algorithms

Evolutionary Strategies

Evolutionary Programming

Genetic Programming

More similarities than differences

Page 6: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Genetic AlgorithmsIn 1950s, Biologists used computers for biological 

system simulation.

First introduced in 1960s by John Holland from the 

University of Michigan

Modeling Adaptive Process

Designed to solve discrete/integer optimization 

problem

Page 7: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Genetic AlgorithmsOperate on Binary Strings, binary as the 

representation of individuals

Applying recombination operator with mutation as 

background operator

Page 8: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Evolutionary StrategiesFirst developed by Rechenberg in 1973

Solved parameter optimization problems

Individuals represented as a pair of float‐valued vectors

Apply both recombination and self adaptive mutation 

Page 9: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Evolutionary StrategiesSimilar to Genetic Algorithms in recombination and mutation processesDifferences with Genetic Algorithms

Evolutionary Strategies are better at finding local maximum while Genetic Algorithms are more suitable at finding global maximumThus, Evolutionary Strategies are faster than Genetic AlgorithmsEvolutionary Strategies are represented as real number vector while GAs are represented using bitstrings

Page 10: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Evolutionary ProgrammingDeveloped by Lawrence Fogel in 1962

Aimed at evolution of Artificial Intelligence in 

developing ability to predict changes in 

environment

Use Finite State Machine for prediction

Page 11: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Evolutionary ProgrammingPredict output of 011101 with 

initial state C, produce

output of 110111

No recombination

Representation based on real‐

valued vectors

1/1

0/0

0/c

0/1

1/1

1/0

A

B

C

Page 12: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Genetic ProgrammingDeveloped by Koza to allow the program to 

evolve by itself during the evolution process

Individuals are represented by Tree or Graphs

Page 13: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Genetic ProgrammingDifferent from GA,ES,EP where representation 

is linear (bit strings and real value vectors), 

Tree is non‐linear

Size depend on Depth and Width, while other 

representations have a fixed size

Only requires crossover OR mutation

Page 14: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

MutationBinary Mutation:

Flipping the bits, as there are only two states of 

binary values : 0 and 1

Mutating (0,1,0,0,1) will produce (1,0,1,0,1)

Page 15: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

MutationReal Value Mutation:

Randomly created value added to the variables 

with some predefined mutation rate

Mutation rate and Mutation step need to be 

defined

Mutation rate is inversely proportional to the 

number of variables (dimensions)

Page 16: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Sources & ReferencesEiben A.E 2004, “What is Evolutionary Algorithm”, Available from: <http://www.cs.vu.nl/~gusz/ecbook/Eiben‐Smith‐Intro2EC‐Ch2.pdf>.[29 August 2012 ].Michalewicz, Z., Hinterding, R., and Michalewicz, M., Evolutionary Algorithms, Chapter 2 in Fuzzy Evolutionary Computation, W. Pedrycz (editor), Kluwer Academic, 1997. T. Bäck, U. Hammel, and H.‐P. Schwefel, “Evolutionary computation: comments on the history and current state”, IEEE Transactions on Evolutionary Computation 1(1), 1997X. Yao, “Evolutionary computation: a gentle introduction”, Evolutionary Optimization, 2002Whitley, D 2001, “An Overview of Evolutionary Algorithm: Practical Issues and Common Pitfalls”,  Information and Software Technology, vol.43, pp. 817‐831

Page 17: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Self AdaptationDon’t know what values to assign to parameters – so let them evolve!Population consisting of real vectors x = (x1,x2,…,xn)We produce offspring by adding random vectors to them

Page 18: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Step SizeSchwefel (1981): add vectors whose components are Gaussian random variates with mean 0What standard deviation should be used?The standard deviation evolves as the algorithm is running

Page 19: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Step SizeRepresent entities as (x,s) – the individual itself (x) and a step vector (s)We start by producing an offspring s’ from s:

si’ = si exp(cn‐1/2N(0,1) + dn‐1/4Ni(0,1))n = generation number, c,d>0 constants

We produce an offspring x’ from x:xi’ = xi + si’Ni(0,1)

Page 20: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Self AdaptationOther parameters can evolve using similar ideasSources:Bäck T, Hammel, U & Schwefel, H‐P 1997, ‘Evolutionary computation: comments on the history and current state’, IEEE Transactions on Evolutionary Computation, vol. 1, no. 1, pp. 3‐17. Available from: IEEE Xplore Digital Library [23rd August 2012]. 

Beyer, HG 1995, ‘Toward a Theory of Evolution Strategies: Self‐Adaptation’, Evolutionary Computation, vol. 3, no. 3, pp. 311‐348. 

Saravanan, N, Fogel, DB & Nelson, KM 1995, ‘A comparison of methods for self‐adaptation in evolutionary algorithms’, BioSystems, vol. 36, no. 2, pp. 157‐166. Available from: Science Direct [26th August 2012].

Schwefel, H‐P 1981, Numerical Optimization of Computer Models, Wiley, Chichester.

Page 21: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

RecombinationProduce offspring from 2 or more entities in the original populationMost easily addressed using bitstring representations

Page 22: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

One Point CrossoverEntities are represented in the population as bitstrings of length nRandomly select a crossover point p from 1 to n(inclusive) Take the substring formed by the first p bits of the first string and append to it the last n‐p bits of the second string to give offspring

Page 23: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

One Point CrossoverBitstrings of length 8:01011100 and 00001111Choose crossover point of 6Take the first 6 bits from 01011100Take the last 2 bits from 00001111Form the offspring 01011111

Page 24: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Uniform CrossoverForm a new offspring from 2 parents by selecting bits from each parent with a particular probabilityFor example, given strings: 11001011 and 01010101Select bits from the first string with probability ½

Page 25: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Uniform CrossoverRolled a die 8 times: 2, 3, 6, 6, 3, 1, 3, 5Whenever the result is 3 or less, take a bit from the first string, otherwise, take a bit from the second string:23663135     2366313511001011 and 01010101Produce offspring: 11011011

Page 26: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Other VariantsMultiple crossover pointsMultiple parentsProbabilistic application

Source:Bäck T, Hammel, U & Schwefel, H‐P 1997, ‘Evolutionary computation: comments on the history and current state’, IEEE Transactions on Evolutionary Computation, vol. 1, no. 1, pp. 3‐17. Available from: IEEE Xplore Digital Library [23rd August 2012].

Page 27: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

SelectionHow individuals and their offspring from one generation are selected to fill the next generationMay be probabilistic or deterministic

Page 28: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Proportional SelectionProbabilistic methodAssume that fitness f(x)>0 for every entity x in the populationp(y) = f(y) / (sum of f(x) for every x)

Page 29: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Tournament SelectionProbabilistic methodSelect q individuals randomly from the population with uniform probabilityThe best individual of this set goes into the next generationRepeat until the next generation is filled

Page 30: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

(μ,λ)‐SelectionDeterministic methodFrom a generation of μ individuals, λ>μ offspring are producedThe next generation is produced from the μ fittest individuals of the λ offspringThe fittest member of the next generation may not be as fit as the fittest member of the previous generation

Page 31: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

(μ+λ)‐SelectionDeterministic methodFrom a generation of μ individuals, λ offspring are producedThe next generation is produced from the μ fittest individuals from the μ+λ parents and offspringThe fittest members will always survive

Page 32: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

SelectionBest method (or methods) will be problem specificSources:Bäck T 1994, ‘Selective pressure in evolutionary algorithms: a characterization of selection mechanisms’, Proceedings of the First IEEE Conference on Evolutionary Computation, pp. 57‐62. Available from: IEEE Xplore Digital Library [28th August 2012].

Bäck T, Hammel, U & Schwefel, H‐P 1997, ‘Evolutionary computation: comments on the history and current state’, IEEE Transactions on Evolutionary Computation, vol. 1, no. 1, pp. 3‐17. Available from: IEEE Xplore Digital Library [23rd August 2012].

Page 33: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Travelling Salesman Problem (TSP)Travelling salesman problem:This is a hard problem (NP‐hard, "at least as hard as the hardest problems in NP")The DP solution is O(n2.2n)Genes are a sequence representing the order that the cities are visited inExample: [0 5 3 4 8 2 1 6 7 9]

Page 34: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Crossover in TSPA possible crossover: The greedy crossover.

"Greedy crossover selects the first city of one parent, compares the cities leaving that city in both parents, and chooses the closer one to extend the tour. If one city has already appeared in the tour, we choose the other city. If both cities have already appeared, we randomly select a non‐selected city."

Sources:J. J. Grefenstetts, R. Gopal, B. Rosmaita, and D. Van Gucht. Genetic Algorithms for the Traveling Salesman problem. In Proceedings of an International Conference on Genetic Algorithms and Their Applications, pages 160–168, 1985.

Page 35: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

Mutation in TSPA possible mutation: The greedy‐swap.

"The basic idea of greedy‐swap is to randomly select two cities from one chromosome and swap them if the new (swapped) tour length is shorter than the old one"Sources:S. J. Louis, R. Tang. Interactive Genetic Algorithms for the Travelling Salesman Problem. Genetic Adaptive Systems Lab, University of Neveda, Reno. 1999.

Page 36: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

ApplicationsEAs are a very powerful computational toolEAs find application in:

bioinformaticsphylogeneticscomputational scienceengineeringeconomicschemistrymanufacturingmathematicsphysics and other fields

Page 37: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

ApplicationsComputer‐automated design

Automotive designDesign composite materials and aerodynamic shapes to provide faster, lighter, more fuel efficient and safer vehiclesNo need to spend time in labs working with models

Engineering designOptimise the design of many tools/components ie. turbines

Page 38: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

ApplicationsGame playing

Sequence of actions can be learnt to win a gameEncryption and code breakingTelecommunicationsDP problems:

Travelling salesman problemPlan for efficient routes and scheduling for travel planners.

Knapsack problem

Page 39: Andrew Cannon Yuki Osada Angeline Honggowarsito€¦ · Knapsack, Trading Prediction in Stock Market, ... Use Finite State Machine for prediction. Evolutionary Programming Predict

SourcesT. Bäck, U. Hammel, and H.‐P. Schwefel, “Evolutionary computation: comments on the history and current state”, IEEE Transactions on Evolutionary Computation 1(1), 1997X. Yao, “Evolutionary computation: a gentle introduction”, Evolutionary Optimization, 2002