SlideShare a Scribd company logo
1 of 23
Download to read offline
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 fitness.

                         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?
               Infinite Loop versus “Stopping Condition”

               Eventually we run out of time / resource / energy.


               Complications:

                         Sometimes “Best” is not well-defined.

                         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 “fitness”

              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 fit, cull least fit.
Monday, January 14, 13                                           8
Genetic Algorithm
              Define degrees of freedom ==> genes.

              Produce first generation with randomized genes.

              Evaluate fitness of each individual

                         Calculate / Run a simulation of environment.

              Keep most fit <==> Cull least fit.

              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 / fight.




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 fitness is evaluated, particles move toward the
             most fit particle in their swarm.

             The most fit 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 fitness 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
Gotcha’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 “satisfices” (good enough)

             Solution is only good inside your simulation.

                         Real world is certainly different.

             Don’t over-train: Solution may lack flexibility.
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 fitness 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

Recently uploaded

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

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 fitness. 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? Infinite Loop versus “Stopping Condition” Eventually we run out of time / resource / energy. Complications: Sometimes “Best” is not well-defined. 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 “fitness” 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 fit, cull least fit. Monday, January 14, 13 8
  • 9. Genetic Algorithm Define degrees of freedom ==> genes. Produce first generation with randomized genes. Evaluate fitness of each individual Calculate / Run a simulation of environment. Keep most fit <==> Cull least fit. 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 / fight. 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 fitness is evaluated, particles move toward the most fit particle in their swarm. The most fit 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 fitness 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. Gotcha’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 “satisfices” (good enough) Solution is only good inside your simulation. Real world is certainly different. Don’t over-train: Solution may lack flexibility. 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 fitness 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