evolutionary computing - 熊本大学 · evolutionary computing vs classical optimization...

28
Evolutionary computing Evolutionary computing: Introduction Classification of evolutionary computing Main steps in evolutionary computing Evolutionary algorithm –vs- classical optimization Genetic Algorithm Applications

Upload: others

Post on 02-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Evolutionary computing

• Evolutionary computing: Introduction

• Classification of evolutionary computing

• Main steps in evolutionary computing

• Evolutionary algorithm –vs- classical optimization

• Genetic Algorithm

• Applications

Page 2: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Evolutionary computing: Introduction

• The world we live in is constantly changing.

• In order to survive in a dynamically changing environment, individuals must have the ability to adapt.

• Evolution is the process of adaption with the aim of improving the survival capabilities through processes such as natural selection, survival of the fittest, reproduction, mutation, competition and symbiosis.

• Evolution in our context is an optimization process

Page 3: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Classification of evolutionary computing

EvolutionaryComputing

Genetic Algorithm (GA)Genetic Algorithm (GA)model genetic evolution

Evolutionary Strategy (ES)Evolutionary Strategy (ES)geared toward modeling the strategic parametersthat control variation in evolution

Genetic Programming (GP)Genetic Programming (GP)based on genetic algorithms, but individuals are programs

Evolutionary Programming (EP)Evolutionary Programming (EP)derived from the simulation of adaptivebehavior in evolution (phenotypic evolution)

Differential Evolution (DE)Differential Evolution (DE)similar to genetic algorithms, different reproduction mechanism

Cultural Evolution (CE)Cultural Evolution (CE)models the evolution of culture of a population and how the culture influences the genetic and phenotypic evolution of individuals.

CoCo--evolution evolution initially "dumb" individuals evolve through cooperation, or in competition with one another, acquiring the necessary characteristics to survive

Page 4: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Evolutionary Computing• Definition: the emulation of the process of natural selection in a search

procedure.

•organisms have certain characteristics that influence their ability to survive and reproduce. •These characteristics are represented by long strings of information contained in the chromosomes of the organism.• The process of natural selection ensures that individuals with the best survival capabilities have the best chance to reproduce.

Nature

Chromosomes are subjected to mutations which cause changes to the characteristics of the corresponding individuals.

negativeinfluence on the individual's ability to survive or reproduce.

Positiveimprove the fitness of an individual, thereby improving its chances of survival

Without mutation:the population tends to converge to a homogeneous state where individuals vary only slightly from each other.

mutations

Page 5: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Several important terms

• In evolutionary computing : model a population of individuals, where an individual is referred to as a chromosome.

• A chromosome defines the characteristics of individuals in the population.

• Each characteristic is referred to as a gene.

• The value of a gene is referred to as an allele.

• Offspring is generated by combining parts of the parents, a process referred to as crossover.

• Each individual in the population can also undergo mutation which alters some of the allele of the chromosome.

• The survival strength of an individual is measured using a fitness function which reflects the objectives and constraints of the problem to be solved.

• After each generation, individuals may undergo culling, or individuals may survive to the next generation (referred to as elitism).

• Additionally, behavioral characteristics (phenotypes) the evolutionary process in two ways genetic changes, and/or behavioral characteristics evolve separately.

Page 6: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Main components of EA search process

Evolution via natural selection of a randomly chosen population of individuals a stochastic search for an optimal solution

• Encoding of solutions to the problem as a chromosome.

• Fitness function – evaluation of individual strength.

• Initialization of the initial populations.

• Selection operators.

• Reproduction operators.

Page 7: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Encoding of solutions to the problem as a chromosome

• The characteristics of an individual are represented by a chromosome, or genome.

Genotype describes the genetic composition of an individual as inherited from its parents. Genotypes provide a mechanism to store experiential evidence as gathered by parents.

chromosome

Phenotype is the expressed behavioral traits of an individual in a specific environment.

How to find an appropriate chromosome representation in EA?(Important!!! The efficiency and complexity of a search algorithm greatly depend on

the representation scheme)•Classical optimization techniques usually use vectors of real numbers•Genetic algorithms (GA) mostly use a binary string representation Boolean values, integers or even discretized real numbers, •Genetic programming (GP) makes use of a tree representation to represent Programs •Evolutionary programming (EP) uses real-valued variables.

Page 8: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Fitness function – evaluation of individual strength

• The fitness function is possibly the most important component of an EA

• The purpose: to map a chromosome representation into a scalar value the evaluation of the fitness function quantifies the quality of that chromosome (how close the solution is to the optimal solution)

• Selection, cross-over, mutation and elitism operators are based on fitness function values.E.g: selection operators use the fitness evaluations to decide which are the best parents to reproduce.

The probability of an individual mutation can be a function of its fitness: highly fit individuals should preferably not be mutated.

• The fitness function should include all criteria to be optimized.

• Penalty can be imposed on those individuals that violate constraints within the fitness function, in the initialization, reproduction and mutation operators.

Page 9: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Initialization of the initial populations• The standard way of generating the initial population is to choose gene

values randomly from the allowed set of values.

• The goal of random selection to ensure that the initial population is a uniform representation of the entire search space.

• If prior knowledge about the search space and problem is available, heuristics can be used to bias the initial population toward potentially good solutions.

• The size of the initial population has consequences for performance in terms of accuracy and the time to converge

A large population covers a larger area of the search space; require less generations to converge. However, the time complexity per generation is increased.

size of the initial population

A small population represents a small part of the search space; the time complexity per generation is low, need more generations to converge

In the case of a small population, the EA can be forced to explore a larger searchspace by increasing the rate of mutation

Page 10: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Selection operators• The new generation is formed through application of three operators:

cross-over, mutation and elitism.

• The aim of the selection operator is to emphasize better solutions in a population

• Cross-over – “superior” individuals are selected.

The next generation is therefore strongly influenced by the genes of the fitter individuals.

• Mutation – individuals with lowest fitness values are mutated ensuring that the good characteristics of the fit individuals persist

• Elitism – this ensures that highest obtained in an generation is not lowered in the next generations but kept the same or improved

Class for selection techniques:• Explicit fitness remapping normalization fitness value to the range [0, 1].

• Implicit fitness remapping the actual fitness values of individuals are used for selection.

Page 11: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Selection operators…contThe most frequently used selection operators:

• Random selection – good or bad individuals have equal chance.

• Proportional Selection – chance of individuals selected is proportional to their fitness. Roulette wheel selection is used. (Probability of ith individual Prob(Cn) = fitness of ithindividual /sum of all individual fitness)

• Tournament Selection – a group of k individuals are randomly selected to take part in a tournament. The winner is selected.

• Rank-Based Selection – Ranking is given either in decreasing or increasing order based on the fitness values.

• Elitism – Best individuals are copied into the next generation.

Page 12: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Reproduction operators

• The purpose of reproduction operators is to produce new offspring from selected individuals, either through cross-overor mutation

• Cross-over is the process of creating a new individual through the combination of the genetic material of two parents.

• Mutation is the process of randomly changing the values of genes in a chromosome – introduces new genetic material into an existing individual, there enlarging the search space.

Page 13: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Pseudocode of General Evolutionary Computing

different EC paradigms use different operators

Convergence is reached when:• the maximum number of generations is exceeded• an acceptable best fit individual has evolved• the average and/or maximum fitness value do not change significantly over the past g generations.

Page 14: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Evolutionary Computing vs Classical Optimization

No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists for solving all problems that is on average superior to any other algorithm the motivation for research into new optimization technique especially EC.

• Classical optimization (CO) algorithms are very successful for linear, quadratic, strongly convex, unimodal problems. EAs are more efficient for discontinuous, non-differentiable, multimodal and noisy problems.

In the search process and informationabout the search space:

use derivative information, using first order or second order,

•COs use deterministic rules to move from one point to other in the search space while ECs use probabilistic transition rules.•COs use sequential search while EAs use parallel search.•COs use derivative information, using first order or second order, of the search space to guide the path to the optimum. ECs use no derivative information. Only fitness values of individuals are used to guide the search.

Page 15: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Genetic Algorithm• Genetic Algorithms (GA) model genetic evolution (genotypes)

• First introduced by John Holland in 1975

Several changes to the original Holland GA have been developed:(1) different representation schemes(2) selection(3) cross-over(4) mutation(5) elitism

operators

The original GAs developed by Holland had distinct features: (1) a bit string representation(2) proportional selection(3) cross-over as the primary method to produce new individuals

Page 16: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

General Genetic Algorithm

Page 17: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Chromosome RepresentationThe classical representation scheme for GAs is binary vectors of fixed length

II--dimensional search space: dimensional search space: each individual consists of Ivariables with each variable encoded as a bit string. If variables have binary values, the length of each chromosome is I bits.

nominalnominal--valued variables:valued variables:each nominal value can be encoded as a D-dimensional bit vector, where 2D is the total number of discrete nominal values for that variable. Each D-bit string represents a different nominal value.

continuouscontinuous--valued variables: valued variables: each variable should be mapped to a D-dimensional bit vector

Binary coding is frequently used; However, it has the disadvantage

Hamming cliffs

Page 18: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Chromosome Representation…cont.

E.g: string-1: 7 = 0111 string-2: 8 = 1000,

Record: 1111Add: 1+1+1+1 = 4 (the Hamming distance is is the number of corresponding bits that differ)

A Hamming cliff is formed when two numerically adjacent values have bit

representations that are far apart

How to calculate Hamming distance:*Ensure the length of strings are equal

*Compare the bits in each string*Record “0”, if they are the same;*Record “1”, if they are different

*Add together the all record values

This presents a problem when a small change in variables should result in a small change in fitness. If, for example, 7 represents the optimal solution, and the current best solution has a fitness of 8, many bits need to be changed to cause a small change in fitness value.

To solve this problem:An alternative bit

representation is to use Gray coding

Page 19: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Chromosome Representation…cont.

Binary numbers can easily be converted to Gray coding using the conversion

Gray Coding

Gray codingGray coding: a binary numerical system where two successive values differ in

only one bit

Decimal Binary Gray code

0 0000 0000

1 0001 0001

2 0010 0011

3 0011 0010

4 0100 0110

5 0101 0111

6 0110 0101

7 0111 0100

8 1000 1100

9 1001 1101

10 1010 1111

11 1011 1110

12 1100 1010

13 1101 1011

14 1110 1001

15 1111 1000

Page 20: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Cross-over• Objective: to produce offspring from two parents; However, it is not

necessary that each group of parents produces offspring

• Crossover takes place with a probability, referred to as the cross-over rate pc e[0, 1].Pseudocode

a mask which specifies which bits of the parents shouldbe swapped to generate offspring

Page 21: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Several cross-over operators have been developedto compute the mask: Uniform, OneUniform, One--point, Twopoint, Two--pointpoint

Uniform CrossUniform Cross--over:over:•the mask of length I is created at random for each pair of individuals selected for reproduction. •A bit with value of 1 indicates that the corresponding allele have to be swapped between the two parents.

Pseudocode:

px :the cross-over probability at each position in the chromosome.

If, e.g px = 0.5, each bit has an equal chance to take part in cross-over

Page 22: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

OneOne--point, Twopoint, Two--pointpoint CrossCross--overover

One-point: A single bit position is randomly selected and the bit substrings after that point are swapped between the two chromosomes

the mask vector is calculated as

Two-point: two bit positions are randomly selected, and the bit substrings between these points are swapped

the mask vector is calculated as

Page 23: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Cross-over…cont.

Page 24: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Mutation• Aim: to introduce new genetic material into an existing individual to

add diversity to the genetic characteristics of the population.

• Mutation also occurs at a certain probability pm, referred to as the mutation rate. Usually, a small value for pm e [0,1] is used to ensure that good solutions are not distorted too much.

• However, initial large mutation rate that decreases exponentially as a function of the number of generations improves convergence speed and accuracy.

• The initial large pm ensures that a large search space is covered, while the pm becomes rapidly smaller when individuals start to converge to the optimum.

• Considering binary representations ; Mutation schemes: -- Random and InRandom and In--orderorder

Page 25: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Random Mutation

The bit positions are chosen randomly and the corresponding bit values negated

A pseudocode algorithm, for random mutation:

Page 26: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Inorder MutationTwo bit positions are randomly selected and only bits between these positions are mutated.

The algorithm for inorder mutation:

Page 27: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Mutation…contIn the case of nominalIn the case of nominal--valued variables: valued variables: the D bits that represent a certain nominal value are replaced by the D bits representing a randomly chosen nominal value. For realFor real--valued representations:valued representations:Mutation occurs by adding a random value to allele, usually sampled from a Gaussian distribution with zero mean and small variance d2:

•The variance d2 is a function of the fitness of the individual. •Individuals with a good fitness value will be mutated less, while a bad fitness value will lead to large mutations.

Page 28: Evolutionary computing - 熊本大学 · Evolutionary Computing vs Classical Optimization No-Free-Lunch theorem [Wolpert and Macready 1996] states that no single algorithm exists

Application of Evolutionary Computing

• planning, e.g: routing optimization and scheduling;

• design, e.g: the design of filters, neural network architectures and structural optimization;

• control, e.g: controllers for gas turbine engines, and visual guidance systems for robots;

• classification and clustering;

• function approximation and time series modeling;

• regression;

• composing music; and

• data mining.