際際滷

際際滷Share a Scribd company logo
Evolving Solutions
                                Machine Learning
                         Programs that Search for Solutions
                             Searching Random Points
                            Recursive Descent / Ascent
                                 Sub-Optimization

                                  Faulty Analogies
                                       Fitness
                                 Genetic Algorithms
                            Particle Swarm Optimization
                                Simulated Annealing



Monday, January 14, 13                                        1
Basic Concepts


Monday, January 14, 13                    2
Learning ==> Improvement

                Some quality is being improved.
                         There is some measure of good / bad.
                There is some way to move toward good.
                         Change position
                         Change behavior


Monday, January 14, 13                                          3
Learning ==>
  Some quality is being improved.

              Implies / Assumes:

                         There is consensus about good versus bad.

                         There is some way to measure good / bad.

              Give that measure a name: Fitness

                         Analogy to nature and evolution concept.


Monday, January 14, 13                                               4
Searching for Better
               Random Search

                         Randomize values in degrees of freedom.

                         Compare resulting 鍖tness.

                         Pick the best results.

                         And then what?

               Recursive Descent / Ascent

                         Assumes that solution space has a gradient.

                         Assumes there are minima / maxima.
Monday, January 14, 13                                                 5
Seeker:
 When do you quit searching?
               In鍖nite Loop versus Stopping Condition

               Eventually we run out of time / resource / energy.


               Complications:

                         Sometimes Best is not well-de鍖ned.

                         The solution space is continuously changing.

                         The shape (gradient qualities) of space is unknown.
Monday, January 14, 13                                                         6
Faulty
                         Analogs
Monday, January 14, 13             7
Evolution
              There is some way to measure 鍖tness

              Fitness is a function of a set of objects
              that can vary over individual instances.

              Call the objects genes to use genetic analogy.

              Mutation ==> Changing the values of genes.

              Sexual Reproduction
              ==> Merging gene sequences.

              Next Generation <== keep most 鍖t, cull least 鍖t.
Monday, January 14, 13                                           8
Genetic Algorithm
              De鍖ne degrees of freedom ==> genes.

              Produce 鍖rst generation with randomized genes.

              Evaluate 鍖tness of each individual

                         Calculate / Run a simulation of environment.

              Keep most 鍖t <==> Cull least 鍖t.

              Populate the next generation. ( mutate and/or splice )

              Repeat until done

                         Note: Real environments change over time.
Monday, January 14, 13                                                  9
Main Loop In Smalltalk




Monday, January 14, 13                        10
Next Generation




Monday, January 14, 13                     11
Mutation




Monday, January 14, 13              12
Degrees Of Freedom




Monday, January 14, 13                    13
See Also: Java Example
                               for
                       Traveling Salesman

      http://code.google.com/p/java-traveling-salesman/
                       source/checkout




Monday, January 14, 13                                    14
Insect (Swarm) Behavior


             Swarms search for food / Encounter intruders
             -- mostly random search.

             Insects communicate with their buddies.

             Their buddies re-direct their paths to gather / 鍖ght.




Monday, January 14, 13                                               15
Particle Swarm Optimization
             Mixed Analogy: Particle <==> Flying insect.

             Particles have position in multi-dimensional space.

             Assign each particle to a group swarm (at random).

             After 鍖tness is evaluated, particles move toward the
             most 鍖t particle in their swarm.

             The most 鍖t particle in the swarm
             can stay where it is, ascend, or dither (random move).

             Recursive ascent / descent may guide moves
             if the space is believed to be reasonably continuous.
Monday, January 14, 13                                                16
http://vimeo.com/17407010




Monday, January 14, 13                  17
Stopping Conditions
             How good is good enough?

             Genetic Algorithms and Particle Swarm Optimization
             can provide multiple solutions.

             Stop when best 鍖tness is no longer improving.

             Stop when move method is no longer moving anything.

             Stop at some arbitrary limit:

                         Number of generations.

                         Time limit.

Monday, January 14, 13                                             18
Simulated Annealing
               Concept: Temperature ==> Energy Available.

                         Energy ==> speed of movement.

                         Speed == How much change from step to step?

               Annealing == Cooling at controlled rate ==>
               The allowed change decreases from step to step.

               Stopping Condition:

                         Temperature (Change/Step) goes to zero.

                         Other stopping conditions may also apply.

Monday, January 14, 13                                                 19
赫看岳界鞄温s
             Experts refuse to say optimum / optimal / optimized

                         No way to verify solution is best possible.

                         Parameters selected may not cover everything.

                         Say sub-optimal or satis鍖ces (good enough)

             Solution is only good inside your simulation.

                         Real world is certainly different.

             Dont over-train: Solution may lack 鍖exibility.
Monday, January 14, 13                                                    20
Visualization
             How do you visualize position in hyperspace?

             Assign each degree of freedom to some geometry.

                    3 degrees (x,y,z) ==> position

                    2 degrees (angle, angle) ==> orientation of axis

                    additional degrees ==> shape dimensions

             Example: Torus (donut) Shape -- 9 shape dimensions

                    Radius, Eccentricity, Angle (?), r, e, a

                    frequency of: twist, wave, bulge
Monday, January 14, 13                                                   21
http://megaswf.com/serve/




Monday, January 14, 13                   22
Lessons Learned
             I did not and do not expect this to work.
             It is just something I always wanted to tinker.

             Best 鍖tness for 2007-2008: Stay out of the market!

             When-to-buy was competing with when-to-sell
             and producing counter-productive results.
             ==> Need more complex strategy ==> more parameters.

             Very compute intensive (generation takes way too long)
             ==> Need faster data structure ==> Refactor database.
             ==> Squeak VM is single-thread ==> Port to Erlang ???
             ==> Potential GPU application.

Monday, January 14, 13                                                23

More Related Content

Similar to Genetic algorithms (20)

PDF
Adaptation in Embodied & Situated Agents
Claudio Martella
ZIP
Genetic Algorithms and Particle Swarm Optimisation @ Flash Brighton, 28th Jul...
inductible
KEY
Gecco 2011 - Effects of Topology on the diversity of spatially-structured evo...
matteodefelice
PDF
Arbonne's Results Presentation
guest06b488
PDF
On the value of stochastic analysis for software engineering
CS, NcState
PDF
The Perfect Conference: Using stochastic optimization to bring people together
Brian Lange
PDF
Optimization Heuristics
Kausal Malladi
PPT
05 adversarial
Nour Zeineddine
PDF
From Galapagos to Twitter: Darwin, Natural Selection, and Web 2.0
Xavier Llor
PPT
Ant colony search and heuristic techniques for optimal dispatch of energy sou...
Beniamino Murgante
PDF
Evolutionary Algorithms and their Applications in Civil Engineering - 1
shreymodi
PDF
Genetic Algorithms
Karthik Sankar
PPTX
CptS 440 / 540 Artificial Intelligence
butest
PDF
Not Dead Yet: Designing Great Experiences with Bad Data
Sonia Koesterer
PDF
Don reinertsen is it time to rethink deming
AGILEMinds
PDF
Introduction to the Genetic Algorithm
Qiang Hao
PPT
Genetic Algorithms
anas_elf
PPTX
l2.pptx
AnujaBeatriceB
PPT
UNIT-5 Optimization (Part-1).ppt
TvVignesh3
PDF
Exact Computation of the Expectation Curves of the Bit-Flip Mutation using La...
jfrchicanog
Adaptation in Embodied & Situated Agents
Claudio Martella
Genetic Algorithms and Particle Swarm Optimisation @ Flash Brighton, 28th Jul...
inductible
Gecco 2011 - Effects of Topology on the diversity of spatially-structured evo...
matteodefelice
Arbonne's Results Presentation
guest06b488
On the value of stochastic analysis for software engineering
CS, NcState
The Perfect Conference: Using stochastic optimization to bring people together
Brian Lange
Optimization Heuristics
Kausal Malladi
05 adversarial
Nour Zeineddine
From Galapagos to Twitter: Darwin, Natural Selection, and Web 2.0
Xavier Llor
Ant colony search and heuristic techniques for optimal dispatch of energy sou...
Beniamino Murgante
Evolutionary Algorithms and their Applications in Civil Engineering - 1
shreymodi
Genetic Algorithms
Karthik Sankar
CptS 440 / 540 Artificial Intelligence
butest
Not Dead Yet: Designing Great Experiences with Bad Data
Sonia Koesterer
Don reinertsen is it time to rethink deming
AGILEMinds
Introduction to the Genetic Algorithm
Qiang Hao
Genetic Algorithms
anas_elf
l2.pptx
AnujaBeatriceB
UNIT-5 Optimization (Part-1).ppt
TvVignesh3
Exact Computation of the Expectation Curves of the Bit-Flip Mutation using La...
jfrchicanog

Recently uploaded (20)

PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
PDF
Unlocking FME Flows Potential: Architecture Design for Modern Enterprises
Safe Software
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
PDF
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
PDF
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
PDF
Kubernetes - Architecture & Components.pdf
geethak285
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
PDF
MPU+: A Transformative Solution for Next-Gen AI at the Edge, a Presentation...
Edge AI and Vision Alliance
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
PPTX
Simplifica la seguridad en la nube y la detecci坦n de amenazas con FortiCNAPP
Cristian Garcia G.
PPTX
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
Unlocking FME Flows Potential: Architecture Design for Modern Enterprises
Safe Software
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
Kubernetes - Architecture & Components.pdf
geethak285
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
MPU+: A Transformative Solution for Next-Gen AI at the Edge, a Presentation...
Edge AI and Vision Alliance
My Journey from CAD to BIM: A True Underdog Story
Safe Software
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
Simplifica la seguridad en la nube y la detecci坦n de amenazas con FortiCNAPP
Cristian Garcia G.
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
Ad

Genetic algorithms

  • 1. Evolving Solutions Machine Learning Programs that Search for Solutions Searching Random Points Recursive Descent / Ascent Sub-Optimization Faulty Analogies Fitness Genetic Algorithms Particle Swarm Optimization Simulated Annealing Monday, January 14, 13 1
  • 3. Learning ==> Improvement Some quality is being improved. There is some measure of good / bad. There is some way to move toward good. Change position Change behavior Monday, January 14, 13 3
  • 4. Learning ==> Some quality is being improved. Implies / Assumes: There is consensus about good versus bad. There is some way to measure good / bad. Give that measure a name: Fitness Analogy to nature and evolution concept. Monday, January 14, 13 4
  • 5. Searching for Better Random Search Randomize values in degrees of freedom. Compare resulting 鍖tness. Pick the best results. And then what? Recursive Descent / Ascent Assumes that solution space has a gradient. Assumes there are minima / maxima. Monday, January 14, 13 5
  • 6. Seeker: When do you quit searching? In鍖nite Loop versus Stopping Condition Eventually we run out of time / resource / energy. Complications: Sometimes Best is not well-de鍖ned. The solution space is continuously changing. The shape (gradient qualities) of space is unknown. Monday, January 14, 13 6
  • 7. Faulty Analogs Monday, January 14, 13 7
  • 8. Evolution There is some way to measure 鍖tness Fitness is a function of a set of objects that can vary over individual instances. Call the objects genes to use genetic analogy. Mutation ==> Changing the values of genes. Sexual Reproduction ==> Merging gene sequences. Next Generation <== keep most 鍖t, cull least 鍖t. Monday, January 14, 13 8
  • 9. Genetic Algorithm De鍖ne degrees of freedom ==> genes. Produce 鍖rst generation with randomized genes. Evaluate 鍖tness of each individual Calculate / Run a simulation of environment. Keep most 鍖t <==> Cull least 鍖t. Populate the next generation. ( mutate and/or splice ) Repeat until done Note: Real environments change over time. Monday, January 14, 13 9
  • 10. Main Loop In Smalltalk Monday, January 14, 13 10
  • 13. Degrees Of Freedom Monday, January 14, 13 13
  • 14. See Also: Java Example for Traveling Salesman http://code.google.com/p/java-traveling-salesman/ source/checkout Monday, January 14, 13 14
  • 15. Insect (Swarm) Behavior Swarms search for food / Encounter intruders -- mostly random search. Insects communicate with their buddies. Their buddies re-direct their paths to gather / 鍖ght. Monday, January 14, 13 15
  • 16. Particle Swarm Optimization Mixed Analogy: Particle <==> Flying insect. Particles have position in multi-dimensional space. Assign each particle to a group swarm (at random). After 鍖tness is evaluated, particles move toward the most 鍖t particle in their swarm. The most 鍖t particle in the swarm can stay where it is, ascend, or dither (random move). Recursive ascent / descent may guide moves if the space is believed to be reasonably continuous. Monday, January 14, 13 16
  • 18. Stopping Conditions How good is good enough? Genetic Algorithms and Particle Swarm Optimization can provide multiple solutions. Stop when best 鍖tness is no longer improving. Stop when move method is no longer moving anything. Stop at some arbitrary limit: Number of generations. Time limit. Monday, January 14, 13 18
  • 19. Simulated Annealing Concept: Temperature ==> Energy Available. Energy ==> speed of movement. Speed == How much change from step to step? Annealing == Cooling at controlled rate ==> The allowed change decreases from step to step. Stopping Condition: Temperature (Change/Step) goes to zero. Other stopping conditions may also apply. Monday, January 14, 13 19
  • 20. 赫看岳界鞄温s Experts refuse to say optimum / optimal / optimized No way to verify solution is best possible. Parameters selected may not cover everything. Say sub-optimal or satis鍖ces (good enough) Solution is only good inside your simulation. Real world is certainly different. Dont over-train: Solution may lack 鍖exibility. Monday, January 14, 13 20
  • 21. Visualization How do you visualize position in hyperspace? Assign each degree of freedom to some geometry. 3 degrees (x,y,z) ==> position 2 degrees (angle, angle) ==> orientation of axis additional degrees ==> shape dimensions Example: Torus (donut) Shape -- 9 shape dimensions Radius, Eccentricity, Angle (?), r, e, a frequency of: twist, wave, bulge Monday, January 14, 13 21
  • 23. Lessons Learned I did not and do not expect this to work. It is just something I always wanted to tinker. Best 鍖tness for 2007-2008: Stay out of the market! When-to-buy was competing with when-to-sell and producing counter-productive results. ==> Need more complex strategy ==> more parameters. Very compute intensive (generation takes way too long) ==> Need faster data structure ==> Refactor database. ==> Squeak VM is single-thread ==> Port to Erlang ??? ==> Potential GPU application. Monday, January 14, 13 23