Contenu connexe Similaire à Introduction aux algorithmes génétiques (20) Plus de JUG Lausanne (20) Introduction aux algorithmes génétiques2. © 2018 CloudBees, Inc. All Rights Reserved. 2
Outline
1. Company introduction
a. Jenkins
b. CloudBees
2. Genetic Algorithms (GA)
a. Introduction to optimization
b. Promise
c. History
d. Genesis
e. Concepts
f. Demo
g. Next steps
3. © 2018 CloudBees, Inc. All Rights Reserved. 3
Code & Commit Build & Config Scan & Test Release Deploy
Over 1.7 Million users 1400+ plugins cover
every stage of delivery
Jenkins is the Hub of Continuous Delivery
4. © 2018 CloudBees, Inc. All Rights Reserved. 4
! !
!
!
!
!
!
Jenkins potential Problems
Jenkins sprawl
Do you know who is using
Jenkins and where?
Stability / plugin quality
Do you have difficulty with upgrades and
plugin compatibility?
Lack of security
Can you control who is doing what
in Jenkins?
Impact of downtime
92% of Jenkins survey respondents say
Jenkins is mission critical. Is it for you?
Performance / scalability issues
Do you need your builds to run faster?
Do you need to run at scale?
Lack of monitoring
Would you like to measure performance
for both Jenkins and your builds?
No technical support
Need experts to call for
Jenkins Tech Support?
5. © 2018 CloudBees, Inc. All Rights Reserved. 5
Speed up and scale Jenkins
Optimized performance, shared
agent pools
CloudBees Jenkins Solutions Make Life Better
Manage Jenkins sprawl
With CloudBees Jenkins
Enterprise
Ensure stability
CloudBees Assurance Program ensures
Jenkins stability and verifies plugins
Apply security to Jenkins
With RBAC and folders for
managing your organization
Make Jenkins highly available
HA and cluster operations features
Monitoring and visualization
Operational and CD Pipeline insight
Expert technical support
CloudBees has the Jenkins
experts on staff
!
! !
!
!
!
!
7. © 2018 CloudBees, Inc. All Rights Reserved. 7
Introduction to mathematical optimization
• Gradient descent
• Follow the slope
• Stochastic walk
• Just random steps
• Hill climbing
• Mix of both
• Simulated annealing
• Ant colony algorithm
8. © 2018 CloudBees, Inc. All Rights Reserved. 8
Promise
• Solve complex problems using simple approach
• Quick approximation of the solution
• Can adapt to a changing environment
• Not requiring complex theory
9. © 2018 CloudBees, Inc. All Rights Reserved. 9
History
1859
1950
1975
1987
1991
“The Origin of species”, Charles Darwin
First idea using evolution, Alan Turing
First development, John Holland
“Genetic Algorithms in Search, Optimization, and Machine
Learning”, David Goldberg
European Conference on Artificial Life
10. © 2018 CloudBees, Inc. All Rights Reserved. 10
Genesis of Genetic Algorithms
• Root of the theory: “The Origin of the species”
• The nature selects the most adapted specimens
11. © 2018 CloudBees, Inc. All Rights Reserved. 11
Concepts of Genetic Algorithms
• Overview
Initial population
Selection
Reproduction /
Crossover
Mutation
Evaluation End
Good enough ?
No
New generation
12. © 2018 CloudBees, Inc. All Rights Reserved. 12
Concepts of Genetic Algorithms
• Genotype (DNA) vs Phenotype (expression of DNA)
• Selection strategy
• Random
▸ a.k.a. brute-force
• Roulette selection
▸ selection rate depends on their ranking / score
• Pareto
▸ 80% of the time, take the 20% best
• Tournament
▸ pick a subset of the population, take the best
13. © 2018 CloudBees, Inc. All Rights Reserved. 13
Concepts of Genetic Algorithms
• Selection strategy
• Fitness / adaptation score
▸ normalization
- distribution of the score among the population
▸ multi steps
- reach goal then optimize energy
▸ multi objectives
- maximize quantity and minimize price
▸ constraint satisfaction (penalty score)
- Knapsack problem
14. © 2018 CloudBees, Inc. All Rights Reserved. 14
Concepts of Genetic Algorithms
• Selection mechanism
• Reproduction / Crossover
▸ Single cut
- Take genes from A until a point, and rest from B
▸ Multiple cuts
▸ Mixing genes
- add quantity of A and B, xoring boolean genes, ...
▸ Random swap
- each gene can be taken from A or B
▸ Problem specific
15. © 2018 CloudBees, Inc. All Rights Reserved. 15
Concepts of Genetic Algorithms
• Mutation mechanism
• Genes encoding
▸ Binary
- Enable / disable feature
▸ Value
- Quantity, price, velocity, force
▸ Tree
- Operation per node
- Programming element per node
16. © 2018 CloudBees, Inc. All Rights Reserved. 16
Concepts of Genetic Algorithms
• Mutation mechanism
• Self-Mutation
▸ Ergodic / pseudo-ergodic hypothesis
- Any solution is reachable by one (or a limited amount of) mutation
▸ Percent to mutate genes individually
▸ Total number of mutation
▸ Multiple types of gene modification
- Swap gene / value
- Modify slightly value
- Simplify or expand node in tree
17. © 2018 CloudBees, Inc. All Rights Reserved. 17
Concepts of Genetic Algorithms
• Exploration vs Exploitation
• Exploration
▸ Testing large portion of the search space in the hope to find good area to refine
- In case of a plane crash at sea, it’s the satellite / aerial overflight to look for something in the
water
• Exploitation
▸ Refine process of a particularly small part of the search space
- It’s when we find some dark area in water that we need to investigate more
• The problem is how to divide time / resources between the two
18. © 2018 CloudBees, Inc. All Rights Reserved. 18
Concepts of Genetic Algorithms
• Effects of the genetic operators
• Selection alone
▸ Tend to have only the best individual and its clones
• Only selection and crossover
▸ Converge quickly to a good but suboptimal solution (pure exploitation)
• Mutation alone
▸ Random walk (pure exploration)
• Only selection and mutation
▸ Parallel hill climbing approach
19. © 2018 CloudBees, Inc. All Rights Reserved. 19
Demo
• Citation (Monkey typing)
• Function approximation
• TSP (Travelling salesman problem)
• Smart Rockets
20. © 2018 CloudBees, Inc. All Rights Reserved. 20
Possible next steps
• GA on GA
• Use GA to determine best parameters for GA
• Diploid instead of haploid
• Double sets of genes instead of just one set
• Real planning application
• Add constraints, real data
• Genetic programming
• Generate compilable code
• Neural network genetic architecture
21. © 2018 CloudBees, Inc. All Rights Reserved. 21
Thank You
https://gitlab.com/wadeck-public/genetik-presentation/wikis/List-of-runnable-demo