SlideShare a Scribd company logo
1 of 43
Download to read offline
Evolutionary Computation
Artificial Intelligence
Nhân bản – Phụng sự – Khai phóng
CONTENTS
• Recap of EC metaphor
• Evolutionary Algorithm
• Genetic Algorithm
Artificial Intelligence 2
CONTENTS
•Recap of EC metaphor
• Evolutionary Algorithm
• Genetic Algorithm
Artificial Intelligence 3
Recap of EC metaphor (1/2)
• 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
4
Recap of EC metaphor (2/2)
• EAs fall into the category of “generate and test” algorithms
• They are stochastic, population-based algorithms
• Variation operators (recombination and mutation) create the necessary
diversity and thereby facilitate novelty
• Selection reduces diversity and acts as a force pushing quality
5
CONTENTS
• Recap of EC metaphor
•Evolutionary Algorithm
• Genetic Algorithm
Artificial Intelligence 6
What is an Evolutionary Algorithm?
• Scheme of an EA
• Main EA components:
• Representation / evaluation / population
• Parent selection / survivor selection
• Recombination / mutation
• Examples: eight-queens problem
• Typical EA behaviour
• EAs and global optimisation
• EC and neighbourhood search
7
Scheme of an EA: General scheme of EAs
8
Population
Parents
Parent selection
Survivor selection
Offspring
Recombination
(crossover)
Mutation
Intialization
Termination
Scheme of an EA: EA scheme in pseudo-code
9
Scheme of an EA: Common model of evolutionary processes
• Population of individuals
• Individuals have a fitness
• Variation operators: crossover, mutation
• Selection towards higher fitness
• “survival of the fittest” and
• “mating of the fittest”
10
Neo Darwinism:
Evolutionary progress towards higher life forms
=
Optimization according to some fitness-criterion
(optimization on a fitness landscape)
Main EA components: Representation (1/2)
• Role: provides code for candidate solutions that can be manipulated by
variation operators
• Leads to two levels of existence
• phenotype: object in original problem context, the outside
• genotype: code to denote that object, the inside (chromosome,
“digital DNA”)
• Implies two mappings:
• Encoding : phenotype=> genotype (not necessarily one to one)
• Decoding : genotype=> phenotype (must be one to one)
• Chromosomes contain genes, which are in (usually fixed) positions
called loci (sing. locus) and have a value (allele)
11
Main EA components: Representation (2/2)
In order to find the global optimum, every feasible solution must be represented in
genotype space
12
Genotype space
Phenotype space
Encoding
(representation)
Decoding
(inverse representation)
10
1001
10010
18
2
9
Example: represent integer values by their binary code
Main EA components: Evaluation (fitness) function
• Role:
• Represents the task to solve, the requirements to adapt to (can be seen as “the
environment”)
• Enables selection (provides basis for comparison)
• e.g., some phenotypic traits are advantageous, desirable, e.g. big ears cool
better, these traits are rewarded by more offspring that will expectedly
carry the same trait
• A.k.a. quality function or objective function
• Assigns a single real-valued fitness to each phenotype which forms the basis
for selection
• So the more discrimination (different values) the better
• Typically we talk about fitness being maximised
• Some problems may be best posed as minimisation problems, but
conversion is trivial
13
Main EA components: Population (1/2)
• Role: holds the candidate solutions of the problem as individuals
(genotypes)
• Formally, a population is a multiset of individuals, i.e. repetitions are
possible
• Population is the basic unit of evolution, i.e., the population is
evolving, not the individuals
• Selection operators act on population level
• Variation operators act on individual level
14
Main EA components: Population (2/2)
• Some sophisticated EAs also assert a spatial structure on the
population e.g., a grid
• Selection operators usually take whole population into account i.e.,
reproductive probabilities are relative to current generation
• Diversity of a population refers to the number of different fitnesses /
phenotypes / genotypes present (note: not the same thing)
15
Main EA components: Selection mechanism (1/3)
Role:
• Identifies individuals
• to become parents
• to survive
• Pushes population towards higher fitness
• Usually probabilistic
• high quality solutions more likely to be selected than low quality
• but not guaranteed
• even worst in current population usually has non-zero probability of
being selected
• This stochastic nature can aid escape from local optima
16
Example: roulette wheel selection
fitness(A) = 3
fitness(B) = 1
fitness(C) = 2
A C
1/6 = 17%
3/6 = 50%
B
2/6 = 33%
Main EA components: Selection mechanism (2/3)
17
In principle, any selection mechanism can be used for
parent selection as well as for survivor selection
Main EA components: Selection mechanism (3/3)
• Survivor selection A.k.a. replacement
• Most EAs use fixed population size so need a way of going from
(parents + offspring) to next generation
• Often deterministic (while parent selection is usually stochastic)
• Fitness based : e.g., rank parents + offspring and take best
• Age based: make as many offspring as parents and delete all
parents
• Sometimes a combination of stochastic and deterministic (elitism)
18
Main EA components: Variation operators
• Role: to generate new candidate solutions
• Usually divided into two types according to their arity (number of
inputs):
• Arity 1 : mutation operators
• Arity >1 : recombination operators
• Arity = 2 typically called crossover
• Arity > 2 is formally possible, seldom used in EC
• There has been much debate about relative importance of
recombination and mutation
• Nowadays most EAs use both
• Variation operators must match the given representation
19
Main EA components: Mutation (1/2)
• Role: causes small, random variance
• Acts on one genotype and delivers another
• Element of randomness is essential and differentiates it from other
unary heuristic operators
• Importance ascribed depends on representation and historical
dialect:
• Binary GAs – background operator responsible for preserving and introducing
diversity
• EP for FSM’s / continuous variables – only search operator
• GP – hardly used
• May guarantee connectedness of search space and hence
convergence proofs
20
before
1 1 1 0 1 1 1
after
1 1 1 1 1 1 1
Main EA components: Mutation (2/2)
21
Main EA components: Recombination (1/2)
• Role: merges information from parents into offspring
• Choice of what information to merge is stochastic
• Most offspring may be worse, or the same as the parents
• Hope is that some are better by combining elements of genotypes
that lead to good traits
• Principle has been used for millennia by breeders of plants and
livestock
22
1 1 1 1 1 1 1 0 0 0 0 0 0 0
Parents
cut cut
Offspring
Main EA components: Recombination (2/2)
23
1 1 1 0 0 0 0 0 0 0 1 1 1 1
Main EA components: Initialisation / Termination
• Initialisation usually done at random,
• Need to ensure even spread and mixture of possible allele values
• Can include existing solutions, or use problem-specific heuristics, to “seed”
the population
• Termination condition checked every generation
• Reaching some (known/hoped for) fitness
• Reaching some maximum allowed number of generations
• Reaching some minimum level of diversity
• Reaching some specified number of generations without fitness
improvement
24
CONTENTS
• Recap of EC metaphor
• Evolutionary Algorithm
•Genetic Algorithm
Artificial Intelligence 25
Introduction
• John Holland in 1975
• A subset of Evolutionary Computation
• A search-based optimization technique based on the principles of
Genetics and Natural Selection
• to find optimal or near-optimal solutions to difficult problems
which otherwise would take a lifetime to solve
• to solve optimization problems, in research, and in machine
learning
• Very popular in various research community
Genetic algorithm
26
Introduction
• Genetic Algorithms have the
ability to deliver a “good-enough”
solution “fast-enough”.
• The reasons why GAs are needed:
• Solving Difficult Problems
• Failure of Gradient Based
Methods
• Getting a Good Solution Fast
27
Components of a GA
A problem to solve, and ...
• Encoding technique (chromosome)
• Initialization procedure (creation)
• Evaluation function (environment)
• Selection of parents (reproduction)
• Genetic operators (mutation, crossover)
Simple Genetic Algorithm
{
initialize population;
evaluate population;
while TerminationCriteriaNotSatisfied
{
select parents for reproduction;
perform recombination and mutation;
evaluate population;
}
}
The GA Cycle of Reproduction
Artificial Intelligence 30
reproduction
population evaluation
modification
discard
deleted
members
parents
children
modified
children
evaluated children
Population
Chromosomes could be:
• Bit strings (0101 ... 1100)
• Real numbers (43.2 -33.1 ... 0.0 89.2)
• Permutations of element (E11 E3 E7 ... E1 E15)
• Lists of rules (R1 R2 R3 ... R22 R23)
• ... any data structure ...
population
Reproduction
reproduction
population
parents
children
Parents are selected at random with selection chances
biased in relation to chromosome evaluations.
Chromosome Modification
modification
children
• Modifications are stochastically triggered
• Operator types are:
• Mutation
• Crossover (recombination)
modified children
Mutation: Local Modification
Before: (1 0 1 1 0 1 1 0)
After: (0 1 1 0 0 1 1 0)
Before: (1.38 -69.4 326.44 0.1)
After: (1.38 -67.5 326.44 0.1)
• Causes movement in the search space (local or global)
• Restores lost information to the population
Crossover: Recombination
P1 (0 1 1 0 1 0 0 0) (0 1 0 0 1 0 0 0) C1
P2 (1 1 0 1 1 0 1 0) (1 1 1 1 1 0 1 0) C2
Crossover is a critical feature of genetic algorithms:
• It greatly accelerates search early in evolution of a population
• It leads to effective combination of schemata (subsolutions on different
chromosomes)
Evaluation
• The evaluator decodes a chromosome and assigns it a fitness measure
• The evaluator is the only link between a classical GA and the problem it is
solving
evaluation
evaluated
children
modified
children
Deletion
• Generational GA:
entire populations replaced with each iteration
• Steady-state GA:
a few members replaced each generation
population
discard
discarded members
A Simple Example
The Traveling Salesman Problem:
Find a tour of a given set of cities so that
• each city is visited only once
• the total distance traveled is minimized
Representation
Representation is an ordered list of city
numbers known as an order-based GA.
1) London 3) Dunedin 5) Beijing 7) Tokyo
2) Venice 4) Singapore 6) Phoenix 8) Victoria
CityList1 (3 5 7 2 1 6 4 8)
CityList2 (2 5 7 6 8 1 3 4)
Crossover
Crossover combines inversion and recombination:
Parent1 (3 5 7 2 1 6 4 8)
Parent2 (2 5 7 6 8 1 3 4)
Child (2 5 7 2 1 6 3 4)
This operator is called the Order1 crossover.
Mutation involves reordering of the list:
Before: (5 8 7 2 1 6 3 4)
After: (5 8 6 2 1 7 3 4)
Mutation
SUMMARY
• Recap of EC metaphor
• Evolutionary Algorithm
• Genetic Algorithm
Artificial Intelligence 42
Artificial Intelligence 43
Enjoy the Course…!
Nhân bản – Phụng sự – Khai phóng

More Related Content

Similar to AI.3-Evolutionary Computation [15-18].pdf

CSA 3702 machine learning module 4
CSA 3702 machine learning module 4CSA 3702 machine learning module 4
CSA 3702 machine learning module 4Nandhini S
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary AlgorithmsReem Alattas
 
Evolutionary algorithms
Evolutionary algorithmsEvolutionary algorithms
Evolutionary algorithmsM S Prasad
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithmritambharaaatre
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktimRaktim Halder
 
Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Raktim Halder
 
Clustering using GA and Hill-climbing
Clustering using GA and Hill-climbingClustering using GA and Hill-climbing
Clustering using GA and Hill-climbingFatemeh Karimi
 
Genetic Algorithms : A class of Evolutionary Algorithms
Genetic Algorithms : A class of Evolutionary AlgorithmsGenetic Algorithms : A class of Evolutionary Algorithms
Genetic Algorithms : A class of Evolutionary AlgorithmsKavya Barnadhya Hazarika
 
Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Kapil Khatiwada
 
Biology-Derived Algorithms in Engineering Optimization
Biology-Derived Algorithms in Engineering OptimizationBiology-Derived Algorithms in Engineering Optimization
Biology-Derived Algorithms in Engineering OptimizationXin-She Yang
 
Genetic Algorithms - GAs
Genetic Algorithms - GAsGenetic Algorithms - GAs
Genetic Algorithms - GAsMohamed Talaat
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithmsCraig Nicol
 
Advanced Optimization Techniques
Advanced Optimization TechniquesAdvanced Optimization Techniques
Advanced Optimization TechniquesValerie Felton
 

Similar to AI.3-Evolutionary Computation [15-18].pdf (20)

Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
CI_L11_Optimization_ag2_eng.pptx
CI_L11_Optimization_ag2_eng.pptxCI_L11_Optimization_ag2_eng.pptx
CI_L11_Optimization_ag2_eng.pptx
 
CI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdfCI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdf
 
CSA 3702 machine learning module 4
CSA 3702 machine learning module 4CSA 3702 machine learning module 4
CSA 3702 machine learning module 4
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary Algorithms
 
Evolutionary algorithms
Evolutionary algorithmsEvolutionary algorithms
Evolutionary algorithms
 
Genetic Algorithm
Genetic Algorithm Genetic Algorithm
Genetic Algorithm
 
Ga ppt (1)
Ga ppt (1)Ga ppt (1)
Ga ppt (1)
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithm
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktim
 
Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP
 
Clustering using GA and Hill-climbing
Clustering using GA and Hill-climbingClustering using GA and Hill-climbing
Clustering using GA and Hill-climbing
 
Genetic Algorithms : A class of Evolutionary Algorithms
Genetic Algorithms : A class of Evolutionary AlgorithmsGenetic Algorithms : A class of Evolutionary Algorithms
Genetic Algorithms : A class of Evolutionary Algorithms
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)
 
Biology-Derived Algorithms in Engineering Optimization
Biology-Derived Algorithms in Engineering OptimizationBiology-Derived Algorithms in Engineering Optimization
Biology-Derived Algorithms in Engineering Optimization
 
Genetic Algorithms - GAs
Genetic Algorithms - GAsGenetic Algorithms - GAs
Genetic Algorithms - GAs
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Advanced Optimization Techniques
Advanced Optimization TechniquesAdvanced Optimization Techniques
Advanced Optimization Techniques
 

Recently uploaded

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 

Recently uploaded (20)

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 

AI.3-Evolutionary Computation [15-18].pdf

  • 1. Evolutionary Computation Artificial Intelligence Nhân bản – Phụng sự – Khai phóng
  • 2. CONTENTS • Recap of EC metaphor • Evolutionary Algorithm • Genetic Algorithm Artificial Intelligence 2
  • 3. CONTENTS •Recap of EC metaphor • Evolutionary Algorithm • Genetic Algorithm Artificial Intelligence 3
  • 4. Recap of EC metaphor (1/2) • 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 4
  • 5. Recap of EC metaphor (2/2) • EAs fall into the category of “generate and test” algorithms • They are stochastic, population-based algorithms • Variation operators (recombination and mutation) create the necessary diversity and thereby facilitate novelty • Selection reduces diversity and acts as a force pushing quality 5
  • 6. CONTENTS • Recap of EC metaphor •Evolutionary Algorithm • Genetic Algorithm Artificial Intelligence 6
  • 7. What is an Evolutionary Algorithm? • Scheme of an EA • Main EA components: • Representation / evaluation / population • Parent selection / survivor selection • Recombination / mutation • Examples: eight-queens problem • Typical EA behaviour • EAs and global optimisation • EC and neighbourhood search 7
  • 8. Scheme of an EA: General scheme of EAs 8 Population Parents Parent selection Survivor selection Offspring Recombination (crossover) Mutation Intialization Termination
  • 9. Scheme of an EA: EA scheme in pseudo-code 9
  • 10. Scheme of an EA: Common model of evolutionary processes • Population of individuals • Individuals have a fitness • Variation operators: crossover, mutation • Selection towards higher fitness • “survival of the fittest” and • “mating of the fittest” 10 Neo Darwinism: Evolutionary progress towards higher life forms = Optimization according to some fitness-criterion (optimization on a fitness landscape)
  • 11. Main EA components: Representation (1/2) • Role: provides code for candidate solutions that can be manipulated by variation operators • Leads to two levels of existence • phenotype: object in original problem context, the outside • genotype: code to denote that object, the inside (chromosome, “digital DNA”) • Implies two mappings: • Encoding : phenotype=> genotype (not necessarily one to one) • Decoding : genotype=> phenotype (must be one to one) • Chromosomes contain genes, which are in (usually fixed) positions called loci (sing. locus) and have a value (allele) 11
  • 12. Main EA components: Representation (2/2) In order to find the global optimum, every feasible solution must be represented in genotype space 12 Genotype space Phenotype space Encoding (representation) Decoding (inverse representation) 10 1001 10010 18 2 9 Example: represent integer values by their binary code
  • 13. Main EA components: Evaluation (fitness) function • Role: • Represents the task to solve, the requirements to adapt to (can be seen as “the environment”) • Enables selection (provides basis for comparison) • e.g., some phenotypic traits are advantageous, desirable, e.g. big ears cool better, these traits are rewarded by more offspring that will expectedly carry the same trait • A.k.a. quality function or objective function • Assigns a single real-valued fitness to each phenotype which forms the basis for selection • So the more discrimination (different values) the better • Typically we talk about fitness being maximised • Some problems may be best posed as minimisation problems, but conversion is trivial 13
  • 14. Main EA components: Population (1/2) • Role: holds the candidate solutions of the problem as individuals (genotypes) • Formally, a population is a multiset of individuals, i.e. repetitions are possible • Population is the basic unit of evolution, i.e., the population is evolving, not the individuals • Selection operators act on population level • Variation operators act on individual level 14
  • 15. Main EA components: Population (2/2) • Some sophisticated EAs also assert a spatial structure on the population e.g., a grid • Selection operators usually take whole population into account i.e., reproductive probabilities are relative to current generation • Diversity of a population refers to the number of different fitnesses / phenotypes / genotypes present (note: not the same thing) 15
  • 16. Main EA components: Selection mechanism (1/3) Role: • Identifies individuals • to become parents • to survive • Pushes population towards higher fitness • Usually probabilistic • high quality solutions more likely to be selected than low quality • but not guaranteed • even worst in current population usually has non-zero probability of being selected • This stochastic nature can aid escape from local optima 16
  • 17. Example: roulette wheel selection fitness(A) = 3 fitness(B) = 1 fitness(C) = 2 A C 1/6 = 17% 3/6 = 50% B 2/6 = 33% Main EA components: Selection mechanism (2/3) 17 In principle, any selection mechanism can be used for parent selection as well as for survivor selection
  • 18. Main EA components: Selection mechanism (3/3) • Survivor selection A.k.a. replacement • Most EAs use fixed population size so need a way of going from (parents + offspring) to next generation • Often deterministic (while parent selection is usually stochastic) • Fitness based : e.g., rank parents + offspring and take best • Age based: make as many offspring as parents and delete all parents • Sometimes a combination of stochastic and deterministic (elitism) 18
  • 19. Main EA components: Variation operators • Role: to generate new candidate solutions • Usually divided into two types according to their arity (number of inputs): • Arity 1 : mutation operators • Arity >1 : recombination operators • Arity = 2 typically called crossover • Arity > 2 is formally possible, seldom used in EC • There has been much debate about relative importance of recombination and mutation • Nowadays most EAs use both • Variation operators must match the given representation 19
  • 20. Main EA components: Mutation (1/2) • Role: causes small, random variance • Acts on one genotype and delivers another • Element of randomness is essential and differentiates it from other unary heuristic operators • Importance ascribed depends on representation and historical dialect: • Binary GAs – background operator responsible for preserving and introducing diversity • EP for FSM’s / continuous variables – only search operator • GP – hardly used • May guarantee connectedness of search space and hence convergence proofs 20
  • 21. before 1 1 1 0 1 1 1 after 1 1 1 1 1 1 1 Main EA components: Mutation (2/2) 21
  • 22. Main EA components: Recombination (1/2) • Role: merges information from parents into offspring • Choice of what information to merge is stochastic • Most offspring may be worse, or the same as the parents • Hope is that some are better by combining elements of genotypes that lead to good traits • Principle has been used for millennia by breeders of plants and livestock 22
  • 23. 1 1 1 1 1 1 1 0 0 0 0 0 0 0 Parents cut cut Offspring Main EA components: Recombination (2/2) 23 1 1 1 0 0 0 0 0 0 0 1 1 1 1
  • 24. Main EA components: Initialisation / Termination • Initialisation usually done at random, • Need to ensure even spread and mixture of possible allele values • Can include existing solutions, or use problem-specific heuristics, to “seed” the population • Termination condition checked every generation • Reaching some (known/hoped for) fitness • Reaching some maximum allowed number of generations • Reaching some minimum level of diversity • Reaching some specified number of generations without fitness improvement 24
  • 25. CONTENTS • Recap of EC metaphor • Evolutionary Algorithm •Genetic Algorithm Artificial Intelligence 25
  • 26. Introduction • John Holland in 1975 • A subset of Evolutionary Computation • A search-based optimization technique based on the principles of Genetics and Natural Selection • to find optimal or near-optimal solutions to difficult problems which otherwise would take a lifetime to solve • to solve optimization problems, in research, and in machine learning • Very popular in various research community Genetic algorithm 26
  • 27. Introduction • Genetic Algorithms have the ability to deliver a “good-enough” solution “fast-enough”. • The reasons why GAs are needed: • Solving Difficult Problems • Failure of Gradient Based Methods • Getting a Good Solution Fast 27
  • 28. Components of a GA A problem to solve, and ... • Encoding technique (chromosome) • Initialization procedure (creation) • Evaluation function (environment) • Selection of parents (reproduction) • Genetic operators (mutation, crossover)
  • 29. Simple Genetic Algorithm { initialize population; evaluate population; while TerminationCriteriaNotSatisfied { select parents for reproduction; perform recombination and mutation; evaluate population; } }
  • 30. The GA Cycle of Reproduction Artificial Intelligence 30 reproduction population evaluation modification discard deleted members parents children modified children evaluated children
  • 31. Population Chromosomes could be: • Bit strings (0101 ... 1100) • Real numbers (43.2 -33.1 ... 0.0 89.2) • Permutations of element (E11 E3 E7 ... E1 E15) • Lists of rules (R1 R2 R3 ... R22 R23) • ... any data structure ... population
  • 32. Reproduction reproduction population parents children Parents are selected at random with selection chances biased in relation to chromosome evaluations.
  • 33. Chromosome Modification modification children • Modifications are stochastically triggered • Operator types are: • Mutation • Crossover (recombination) modified children
  • 34. Mutation: Local Modification Before: (1 0 1 1 0 1 1 0) After: (0 1 1 0 0 1 1 0) Before: (1.38 -69.4 326.44 0.1) After: (1.38 -67.5 326.44 0.1) • Causes movement in the search space (local or global) • Restores lost information to the population
  • 35. Crossover: Recombination P1 (0 1 1 0 1 0 0 0) (0 1 0 0 1 0 0 0) C1 P2 (1 1 0 1 1 0 1 0) (1 1 1 1 1 0 1 0) C2 Crossover is a critical feature of genetic algorithms: • It greatly accelerates search early in evolution of a population • It leads to effective combination of schemata (subsolutions on different chromosomes)
  • 36. Evaluation • The evaluator decodes a chromosome and assigns it a fitness measure • The evaluator is the only link between a classical GA and the problem it is solving evaluation evaluated children modified children
  • 37. Deletion • Generational GA: entire populations replaced with each iteration • Steady-state GA: a few members replaced each generation population discard discarded members
  • 38. A Simple Example The Traveling Salesman Problem: Find a tour of a given set of cities so that • each city is visited only once • the total distance traveled is minimized
  • 39. Representation Representation is an ordered list of city numbers known as an order-based GA. 1) London 3) Dunedin 5) Beijing 7) Tokyo 2) Venice 4) Singapore 6) Phoenix 8) Victoria CityList1 (3 5 7 2 1 6 4 8) CityList2 (2 5 7 6 8 1 3 4)
  • 40. Crossover Crossover combines inversion and recombination: Parent1 (3 5 7 2 1 6 4 8) Parent2 (2 5 7 6 8 1 3 4) Child (2 5 7 2 1 6 3 4) This operator is called the Order1 crossover.
  • 41. Mutation involves reordering of the list: Before: (5 8 7 2 1 6 3 4) After: (5 8 6 2 1 7 3 4) Mutation
  • 42. SUMMARY • Recap of EC metaphor • Evolutionary Algorithm • Genetic Algorithm Artificial Intelligence 42
  • 43. Artificial Intelligence 43 Enjoy the Course…! Nhân bản – Phụng sự – Khai phóng