Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Genetic Algorithms / BeeScala

278 views

Published on

Slides of my talk "Genetic Algorithms" at BeeScala 2016
http://bee-scala.org

Published in: Software
  • Be the first to comment

Genetic Algorithms / BeeScala

  1. 1. Hello
  2. 2. 1848 1895 5% 98%
  3. 3. Genetic Algorithms
  4. 4. The Traveling Salesman Problem B C D A F E
  5. 5. Initialization Population Fitness Selection CrossoverMutation 0 0 0 1 1 1 0 1 1 0 1 1 1 1 1 0 0 0 1 0 1 0 1 1 1
  6. 6. Initialization Population Fitness Selection CrossoverMutation 0 0 0 1 1 1 0 1 1 0 1 1 1 1 1 0 0 0 1 0 1 0 1 1 1 2 8 4 4 2
  7. 7. Initialization Population Fitness Selection CrossoverMutation 0 0 0 1 1 1 0 1 1 0 1 1 1 1 1 0 0 0 1 0 1 0 1 1 1 2 8 4 4 2 0.1 0.4 0.2 0.2 0.1
  8. 8. 0 0 0 1 1 1 0 1 1 0 Initialization Population Fitness Selection CrossoverMutation 0 0 1 1 0
  9. 9. 0 0 1 1 0 Initialization Population Fitness Selection CrossoverMutation 0 1 1 1 0
  10. 10. Initialization Population Fitness Selection CrossoverMutation 0 0 0 1 1 1 0 1 1 0 1 1 1 1 1 0 0 0 1 0 1 0 1 1 1
  11. 11. Initialization Population Fitness Selection CrossoverMutation 0 0 0 1 1 1 0 1 1 0 1 1 1 1 1 0 0 0 1 0 1 0 1 1 1
  12. 12. Initialization Population Fitness Selection CrossoverMutation Termination criteria? 1 0 1 1 0 1 1 1 1 1 0 0 0 1 0 1 0 1 1 1
  13. 13. Initialization Population Fitness Selection CrossoverMutation Termination criteria? 1 0 1 1 0 1 1 1 1 1 0 0 0 1 0 1 0 1 1 1
  14. 14. Initialization Population Fitness Selection CrossoverMutation Termination criteria? Solution 0 0 0 1 0
  15. 15. Hello, world!
  16. 16. Representation H e l l o , W o r l d !
  17. 17. Initialization Initialization Population Fitness Selection CrossoverMutation P e l X ] x e _ l x Y p 7 o
  18. 18. Fitness evaluation P e l X ] x e _ l x Y p 7 o Initialization Population Fitness Selection CrossoverMutation 2 2 1
  19. 19. B C D A F E
  20. 20. Selection P e l X ] x e _ l x Y p 7 o 2 Initialization Population Fitness Selection CrossoverMutation 2 1
  21. 21. Crossover P e l X ] x e _ l x P e l Initialization Population Fitness Selection CrossoverMutation l x
  22. 22. B C D A F E
  23. 23. Mutation P e l l x P e l l x Initialization Population Fitness Selection CrossoverMutation P e l l w
  24. 24. B C D A F E
  25. 25. Generation 1: Lx[uH%#iHbWT" Generation 2: Mq&mn0/jpUv^# Generation 3: Kxqlp1#gkpj.4 Generation 4: Kxqlp1#g_qjf= Generation 5: Kxqlp1#gkpmc1 Generation 6: Kxqlp1#gkpmc, Generation 7: M_nmo,+qqohU! Generation 8: Cfslp1#whwme' Generation 9: Hfsmt0'skpje$ Generation 10: Neomu,#wslkd# Generation 11: Meomu,#wslkd# Generation 12: Caqlo0#yosmc Generation 13: Cfklo0#yosmc Generation 14: Henlo0#yosmc Generation 15: Henlo0#yosmc Generation 16: Gfnmo,#wosmc Generation 17: Hfkmo,#wosmc Generation 18: Hfkmo,#wosmc Generation 19: Henlo,#wosmd Generation 20: Henlo,#wosmd" Generation 21: Heklp,"wosmd" Generation 22: Heklp,"wosmd" Generation 23: Heklo,"wosmd" Generation 24: Heklo,"wosmd! Generation 25: Heklo,"wosmd! Generation 26: Heklo,!wosmd! Generation 27: Heklo,!wosmd! Generation 28: Heklo,!wosld! Generation 29: Heklo,!wosld! Generation 30: Hello,!wosld! Generation 31: Hello,!wosld! Generation 32: Hello,!wosld! Generation 33: Hello,!wosld! Generation 34: Hello,!wosld! Generation 35: Hello, wosld! Generation 36: Hello, wosld! Generation 37: Hello, wosld! Generation 38: Hello, wosld! Generation 39: Hello, wosld! Generation 40: Hello, wosld! Generation 41: Hello, wosld! Generation 42: Hello, wosld! Generation 43: Hello, wosld! Generation 44: Hello, wosld! Generation 45: Hello, wosld! Generation 46: Hello, wosld! Generation 47: Hello, wosld! Generation 48: Hello, wosld! Generation 49: Hello, world! Generation 15: Henlo0#yosmc Generation 18: Hfkmo,#wosmc Generation 19: Henlo,#wosmd Generation 48: Hello, wosld! Generation 49: Hello, world!
  26. 26. Evolving Mona Lisa
  27. 27. R (x,y,z) (r,g,b,a) Representation
  28. 28. ...R (x,y,z) (r,g,b,a) R (x,y,z) (r,g,b,a) R (x,y,z) (r,g,b,a) Representation
  29. 29. Generation 1 Generation 4951 | 10 min Generation 2941 | 5 min Generation 55638 | 166 min
  30. 30. Why does it work? fitness Search space
  31. 31. Implementation issues 1. Performance 2. Memory
  32. 32. Implementation issues 1. Performance 2. Memory
  33. 33. slave master slave slave Master ● EvolvingActor ● CrossoverActor ● MutationActor Slave ● FitnessActor ClusterActorRefProvider
  34. 34. sub-population sub-population sub-population sub-population Node ● EvolvingActor ● CrossoverActor ● MutationActor ● FitnessActor ClusterActorRefProvider ClusterRouterGroup
  35. 35. Implementation issues 1. Performance 2. Memory
  36. 36. Eden S0 S1 Old Metaspace Young Generation Old Generation Permanent Generation
  37. 37. http://jenetics.io/ http://jgap.sourceforge.net/ Scala for Machine Learning / Patrick Nicolas Being Creative with Genetic Algorithms and Typeclasses / Noel Markham
  38. 38. One last thing ✔ Representation ✔ Fitness
  39. 39. tzofia@overops.com @tzofias

×