Selection of the optimal parameters for machine learning tasks is challenging. Some results may be bad not because the data is noisy or the used learning algorithm is weak, but due to the bad selection of the parameters values. This presentation gives a brief introduction about evolutionary algorithms (EAs) and describes genetic algorithm (GA) which is one of the simplest random-based EAs. A step-by-step example is given in addition to its implementation in Python 3.5.
---------------------------------
Read more about GA:
Yu, Xinjie, and Mitsuo Gen.ย Introduction to evolutionary algorithms. Springer Science & Business Media, 2010.
https://www.kdnuggets.com/2018/03/introduction-optimization-with-genetic-algorithm.html
https://www.linkedin.com/pulse/introduction-optimization-genetic-algorithm-ahmed-gad
6. ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐
-1 2 2 -3 2 0.9
Solution 3
๐โฒ
= ๐๐. ๐
Absolute Error ๐๐๐๐๐ = |๐ โ ๐โฒ
|
๐๐๐๐๐ = ๐๐. ๐
๐๐๐๐๐ = ๐๐. ๐ โ ๐๐. ๐
Difficult to find the best solution manually.
Use optimization technique such as Genetic Algorithm (GA).
7. โข Genetic algorithm is based on natural evolution of organisms.
โข A brief biological background will be helpful in understanding GA.
Genetic Algorithm (GA)
8. โข Genetic algorithm is based on natural evolution of organisms.
โข A brief biological background will be helpful in understanding GA.
Chromosomes
Genes
Eye
Color
Dimples Freckles
Organism
Cells
Genetic Algorithm (GA)
9. โข Genetic algorithm is based on natural evolution of organisms.
โข A brief biological background will be helpful in understanding GA.
Chromosomes
Genes
Eye
Color
Dimples Freckles
Organism
Cells
Genetic Algorithm (GA)
https://www.icr.org/article/myth-human-evolution
10. โข Genetic algorithm is based on natural evolution of organisms.
โข A brief biological background will be helpful in understanding GA.
Chromosome
Genes
GA
Individuals/Solutions
Genetic Algorithm (GA)
Chromosomes
Genes
Eye
Color
Dimples Freckles
Organism
Cells
11. What are the Genes?
โข Gene is anything that is able to enhance the results when changed.
โข By exploring the following model, the 6 weights are able to enhance
the results. Thus each weight will represent a gene in GA.
๐ = ๐ ๐ ๐ ๐+๐ ๐ ๐ ๐+๐ ๐ ๐ ๐+๐ ๐ ๐ ๐+๐ ๐ ๐ ๐+๐ ๐ ๐ ๐
Gene 0 Gene 1 Gene 2 Gene 3 Gene 4 Gene 5
๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐
40. -1 2 2 -3 2 0.9
3.1 4 0 2.4 4.8 0
-2 3 -7 6 3 3
-2 3 -7 -3 1 0.9
3.1 4 0 6 1.5 3
-1 2 2 2.4 2.4 0
Old
Individuals
New
Individuals
New Population (Generation 1)
Why Reusing Old Individuals?
41. -1 2 2 -3 2 0.9
3.1 4 0 2.4 4.8 0
-2 3 -7 6 3 3
-2 3 -7 -3 1 0.9
3.1 4 0 6 1.5 3
-1 2 2 2.4 2.4 0
Old
Individuals
New
Individuals
New Population (Generation 1)
Why Reusing Old Individuals?
GA is a random-based optimization technique. There is no guarantee that the new individuals will be better
than the previous individuals. Keeping the old individuals at least saves the results from getting worse.
42. New Population (Generation 1)
Old
Individuals
New
Individuals
Population Mating Pool Crossover MutationFitness Value
-1 2 2 -3 2 0.9
3.1 4 0 2.4 4.8 0
-2 3 -7 6 3 3
-2 3 -7 -3 1 0.9
3.1 4 0 6 1.5 3
-1 2 2 2.4 2.4 0