SlideShare une entreprise Scribd logo
1  sur  23
AprendizagemAutomática Mestrado  em Engenharia Informática
Sumário Espaços de Soluções Métodos de procura Algoritmos Genéticos 01-10-2010 Aprendizagem Automática / Machine Learning 2
Problema (Caixeiro Viajante) Dado um conjunto de pontos e as distâncias entre eles, qual a ordem de visita que minimiza o caminho percorrido passando por todos os pontos, uma única vez em cada ponto. 01-10-2010 Aprendizagem Automática / Machine Learning 3
Espaço de soluções Dadas as cidades (pontos) A, B, C ... as soluções são todas as combinações possíveis em que estão representadas apenas uma vez todas as cidades Podemos ver estas soluções ligadas entre si como um espaço / grafo Umas soluções podem ser transformadas noutras por (por exemplo) troca de posições entre duas cidades 01-10-2010 Aprendizagem Automática / Machine Learning 4
Espaço de Soluções 01-10-2010 Aprendizagem Automática / Machine Learning 5 Custo  Solução de mais baixo custo  Soluçõespossíveis
Problema dos mínimos Locais Mínimos locais Custo                                 Valores de um Parâmetro 01-10-2010 Aprendizagem Automática / Machine Learning 6
Métodos de procura Sequencial (experimentar todas as combinações) Aleatório (experimentar várias combinações, escolher a melhor) A* (fazer todas as alterações possíveis à melhor solução encontrada até ao momento) SimulatedAnnealing (Arrefecimento simulado) Algoritmos Genéticos (Genetic / EvolutionaryAlgorithms) 01-10-2010 Aprendizagem Automática / Machine Learning 7
SimulatedAnnealing[Kirkpatrick et al. 83] Semelhante ao processo de arrefecimento de ligas metálicas Tenta prevenir problema dos mínimos locais Exploração aleatória Aceita novo estado ,[object Object]
Com uma probabilidade decrescente, mesmo quando é pior (prob. controlada por diferença ao melhor e temperatura)01-10-2010 Aprendizagem Automática / Machine Learning 8
SimulatedAnnealing[Kirkpatrick et al. 83] Probabilidade de aceitação de novo estado 01-10-2010 Aprendizagem Automática / Machine Learning 9
Algoritmos Genéticos (GA)[Holland 75] Inspirado na teoria da evolução das espécies Tenta encontrar soluções com maior aptidão: gerando uma “população” de soluções possíveis,  avaliando-as mutando ou recombinando as mais promissoras, gerando nova população 01-10-2010 Aprendizagem Automática / Machine Learning 10
GA: Aptidão / Fitness Capacidade para resolver o problema Inverso do erro / custo Adequação de um padrão à resolução do problema Conveniente que seja um número real e que as diferenças nas soluções sejam tão precisas quanto possível Avaliação dos “sobreviventes”:  Proporcional à qualidade da solução N melhores Torneio … 01-10-2010 Aprendizagem Automática / Machine Learning 11
GA: Ciclo de Vida Para N gerações (ou até Fbest > E ) Para Si (Espécime/Specimen) em população Avaliar Si -> Fi (Aptidão/Fitness) Escolher os melhores (Bi) (selectedpool / survivors) Gerar nova população, para Si Si = mutate(Ba): a = rand (prioridade aos mais aptos)? OU Si = crossover(Ba, Bb):  a, b = rand 01-10-2010 Aprendizagem Automática / Machine Learning 12
Problema 1 (KnapSack) Dada uma mochila com capacidade limitada (peso ou volume) Cada “pacote” tem um peso e um valor (monetário por exemplo) Como escolher que pacotes levar de modo a maximizar o valor dos pacotes, sem exceder o peso 01-10-2010 Aprendizagem Automática / Machine Learning 13
Problema 1 (KnapSack) Formulação para GA 01-10-2010 Aprendizagem Automática / Machine Learning 14 (20,2) (24,3) (10,2) (3,2) … 1 1 0 1 … Cada quadrado indica se o pacote n é levado ou não
Problema 2 (Topologia) Dado um conjunto de problemas, qual a melhor topologia de rede para os resolver? 01-10-2010 Aprendizagem Automática / Machine Learning 15
Problema 2 (Topologia) Qual a melhor topologia de uma rede neuronal? 01-10-2010 Aprendizagem Automática / Machine Learning 16
Problema 3 (Caixeiro Viajante) Ordem das cidades a visitar de modo a diminuir o custo / distância    B, A, C, F, D, … 01-10-2010 Aprendizagem Automática / Machine Learning 17
GA: Um espécime / specimen 01-10-2010 Aprendizagem Automática / Machine Learning 18 1 1 0 0 1 0 1 … B, A, C, F, D, …
GA: Mutação (Mutation) 01-10-2010 Aprendizagem Automática / Machine Learning 19 1 1 0 0 1 0 1 … 1 1 1 0 0 0 1 … A, B, C,  … A, C, B, ….
GA: Recombinação (Crossover) 01-10-2010 Aprendizagem Automática / Machine Learning 20 + crossover-point 1 1 0 0 1 1 0 … 0 1 1 0 0 0 1 … 1 1 0 0 1 0 1 …
EvolutionaryAlgorithms Principais sub-tipos(ver discussão em GA-FAQ) [Heitkoetteret al. 94] GeneticAlgorithms EvolutionaryProgramming / EvolutionStrategies GeneticProgramming ClassifierSystems (NeuroEvolution) 01-10-2010 Aprendizagem Automática / Machine Learning 21
Referências [Metropolis et al. 53] N. Metropolis, A.W. Rosenbluth, M.N. Rosenbluth, A.H. Teller, and E. Teller. "Equations of State Calculations by Fast Computing Machines". Journal of Chemical Physics, 21(6):1087-1092, 1953. [Kirkpatrick et al. 83] Kirkpatrick, S.; C. D. Gelatt, M. P. Vecchi (1983-05-13). "Optimization by Simulated Annealing". Science. New Series 220 (4598): 671-680. ISSN 00368075.  [Cerny 85] V. Cerny, A thermodynamical approach to the travelling salesman problem: an efficient simulation algorithm. Journal of Optimization Theory and Applications, 45:41-51, 1985 [Goldberg 89] D. E. Goldberg, Genetic Algorithms in Search, Optimization and Machine Learning, Kluwer Academic Publishers, Boston, MA, 1989. [Fogel 06] D. B. Fogel, Evolutionary Computation: Toward a New Philosophy of Machine Intelligence, IEEE Press, Piscataway, NJ. Third Edition, 2006. [Holland 75] John H. Holland, Adaptation in Natural and Artificial Systems, University of Michigan Press, Ann Arbor, 1975 [Koka 92] John Koza, Genetic Programming: On the Programming of Computers by Means of Natural Selection, MIT Press. ISBN 0-262-11170-5, 1992 [Heitkoetter et al. 94] Heitkoetter, Joerg and Beasley, David, eds. (1994) "The Hitch- Hiker's Guide to Evolutionary Computation: A list of Frequently Asked Questions (FAQ)", USENET : comp.ai.genetic.  RecursosváriossobreGA 01-10-2010 Aprendizagem Automática / Machine Learning 22

Contenu connexe

En vedette

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
 

En vedette (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...
 

Algoritmos Genéticos

  • 1. AprendizagemAutomática Mestrado em Engenharia Informática
  • 2. Sumário Espaços de Soluções Métodos de procura Algoritmos Genéticos 01-10-2010 Aprendizagem Automática / Machine Learning 2
  • 3. Problema (Caixeiro Viajante) Dado um conjunto de pontos e as distâncias entre eles, qual a ordem de visita que minimiza o caminho percorrido passando por todos os pontos, uma única vez em cada ponto. 01-10-2010 Aprendizagem Automática / Machine Learning 3
  • 4. Espaço de soluções Dadas as cidades (pontos) A, B, C ... as soluções são todas as combinações possíveis em que estão representadas apenas uma vez todas as cidades Podemos ver estas soluções ligadas entre si como um espaço / grafo Umas soluções podem ser transformadas noutras por (por exemplo) troca de posições entre duas cidades 01-10-2010 Aprendizagem Automática / Machine Learning 4
  • 5. Espaço de Soluções 01-10-2010 Aprendizagem Automática / Machine Learning 5 Custo Solução de mais baixo custo Soluçõespossíveis
  • 6. Problema dos mínimos Locais Mínimos locais Custo Valores de um Parâmetro 01-10-2010 Aprendizagem Automática / Machine Learning 6
  • 7. Métodos de procura Sequencial (experimentar todas as combinações) Aleatório (experimentar várias combinações, escolher a melhor) A* (fazer todas as alterações possíveis à melhor solução encontrada até ao momento) SimulatedAnnealing (Arrefecimento simulado) Algoritmos Genéticos (Genetic / EvolutionaryAlgorithms) 01-10-2010 Aprendizagem Automática / Machine Learning 7
  • 8.
  • 9. Com uma probabilidade decrescente, mesmo quando é pior (prob. controlada por diferença ao melhor e temperatura)01-10-2010 Aprendizagem Automática / Machine Learning 8
  • 10. SimulatedAnnealing[Kirkpatrick et al. 83] Probabilidade de aceitação de novo estado 01-10-2010 Aprendizagem Automática / Machine Learning 9
  • 11. Algoritmos Genéticos (GA)[Holland 75] Inspirado na teoria da evolução das espécies Tenta encontrar soluções com maior aptidão: gerando uma “população” de soluções possíveis, avaliando-as mutando ou recombinando as mais promissoras, gerando nova população 01-10-2010 Aprendizagem Automática / Machine Learning 10
  • 12. GA: Aptidão / Fitness Capacidade para resolver o problema Inverso do erro / custo Adequação de um padrão à resolução do problema Conveniente que seja um número real e que as diferenças nas soluções sejam tão precisas quanto possível Avaliação dos “sobreviventes”: Proporcional à qualidade da solução N melhores Torneio … 01-10-2010 Aprendizagem Automática / Machine Learning 11
  • 13. GA: Ciclo de Vida Para N gerações (ou até Fbest > E ) Para Si (Espécime/Specimen) em população Avaliar Si -> Fi (Aptidão/Fitness) Escolher os melhores (Bi) (selectedpool / survivors) Gerar nova população, para Si Si = mutate(Ba): a = rand (prioridade aos mais aptos)? OU Si = crossover(Ba, Bb): a, b = rand 01-10-2010 Aprendizagem Automática / Machine Learning 12
  • 14. Problema 1 (KnapSack) Dada uma mochila com capacidade limitada (peso ou volume) Cada “pacote” tem um peso e um valor (monetário por exemplo) Como escolher que pacotes levar de modo a maximizar o valor dos pacotes, sem exceder o peso 01-10-2010 Aprendizagem Automática / Machine Learning 13
  • 15. Problema 1 (KnapSack) Formulação para GA 01-10-2010 Aprendizagem Automática / Machine Learning 14 (20,2) (24,3) (10,2) (3,2) … 1 1 0 1 … Cada quadrado indica se o pacote n é levado ou não
  • 16. Problema 2 (Topologia) Dado um conjunto de problemas, qual a melhor topologia de rede para os resolver? 01-10-2010 Aprendizagem Automática / Machine Learning 15
  • 17. Problema 2 (Topologia) Qual a melhor topologia de uma rede neuronal? 01-10-2010 Aprendizagem Automática / Machine Learning 16
  • 18. Problema 3 (Caixeiro Viajante) Ordem das cidades a visitar de modo a diminuir o custo / distância B, A, C, F, D, … 01-10-2010 Aprendizagem Automática / Machine Learning 17
  • 19. GA: Um espécime / specimen 01-10-2010 Aprendizagem Automática / Machine Learning 18 1 1 0 0 1 0 1 … B, A, C, F, D, …
  • 20. GA: Mutação (Mutation) 01-10-2010 Aprendizagem Automática / Machine Learning 19 1 1 0 0 1 0 1 … 1 1 1 0 0 0 1 … A, B, C, … A, C, B, ….
  • 21. GA: Recombinação (Crossover) 01-10-2010 Aprendizagem Automática / Machine Learning 20 + crossover-point 1 1 0 0 1 1 0 … 0 1 1 0 0 0 1 … 1 1 0 0 1 0 1 …
  • 22. EvolutionaryAlgorithms Principais sub-tipos(ver discussão em GA-FAQ) [Heitkoetteret al. 94] GeneticAlgorithms EvolutionaryProgramming / EvolutionStrategies GeneticProgramming ClassifierSystems (NeuroEvolution) 01-10-2010 Aprendizagem Automática / Machine Learning 21
  • 23. Referências [Metropolis et al. 53] N. Metropolis, A.W. Rosenbluth, M.N. Rosenbluth, A.H. Teller, and E. Teller. "Equations of State Calculations by Fast Computing Machines". Journal of Chemical Physics, 21(6):1087-1092, 1953. [Kirkpatrick et al. 83] Kirkpatrick, S.; C. D. Gelatt, M. P. Vecchi (1983-05-13). "Optimization by Simulated Annealing". Science. New Series 220 (4598): 671-680. ISSN 00368075. [Cerny 85] V. Cerny, A thermodynamical approach to the travelling salesman problem: an efficient simulation algorithm. Journal of Optimization Theory and Applications, 45:41-51, 1985 [Goldberg 89] D. E. Goldberg, Genetic Algorithms in Search, Optimization and Machine Learning, Kluwer Academic Publishers, Boston, MA, 1989. [Fogel 06] D. B. Fogel, Evolutionary Computation: Toward a New Philosophy of Machine Intelligence, IEEE Press, Piscataway, NJ. Third Edition, 2006. [Holland 75] John H. Holland, Adaptation in Natural and Artificial Systems, University of Michigan Press, Ann Arbor, 1975 [Koka 92] John Koza, Genetic Programming: On the Programming of Computers by Means of Natural Selection, MIT Press. ISBN 0-262-11170-5, 1992 [Heitkoetter et al. 94] Heitkoetter, Joerg and Beasley, David, eds. (1994) "The Hitch- Hiker's Guide to Evolutionary Computation: A list of Frequently Asked Questions (FAQ)", USENET : comp.ai.genetic. RecursosváriossobreGA 01-10-2010 Aprendizagem Automática / Machine Learning 22
  • 24. Sumário Espaços de Soluções Métodos de procura Algoritmos Genéticos 01-10-2010 Aprendizagem Automática / Machine Learning 23