SlideShare a Scribd company logo
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

Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
DurgeshPratapSIngh8
 
CI_L11_Optimization_ag2_eng.pptx
CI_L11_Optimization_ag2_eng.pptxCI_L11_Optimization_ag2_eng.pptx
CI_L11_Optimization_ag2_eng.pptx
SantiagoGarridoBulln
 
CI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdfCI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdf
SantiagoGarridoBulln
 
CSA 3702 machine learning module 4
CSA 3702 machine learning module 4CSA 3702 machine learning module 4
CSA 3702 machine learning module 4
Nandhini S
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary Algorithms
Reem Alattas
 
Evolutionary algorithms
Evolutionary algorithmsEvolutionary algorithms
Evolutionary algorithms
M S Prasad
 
Genetic Algorithm
Genetic Algorithm Genetic Algorithm
Genetic Algorithm
Bhushan Mohite
 
Ga ppt (1)
Ga ppt (1)Ga ppt (1)
Ga ppt (1)
RAHUL SOLANKI
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithm
ritambharaaatre
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
Fatemeh Karimi
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktim
Raktim 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-climbing
Fatemeh 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 Algorithms
Kavya Barnadhya Hazarika
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
Sadhana Singh
 
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 Optimization
Xin-She Yang
 
Genetic Algorithms - GAs
Genetic Algorithms - GAsGenetic Algorithms - GAs
Genetic Algorithms - GAs
Mohamed Talaat
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
Craig Nicol
 
Advanced Optimization Techniques
Advanced Optimization TechniquesAdvanced Optimization Techniques
Advanced Optimization Techniques
Valerie 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

Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Leena Ghag-Sakpal
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
spdendr
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 

Recently uploaded (20)

Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 

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