SlideShare a Scribd company logo
1 of 30
Download to read offline
Evolutionary Computing Technology
Sina Mohammadi, Mohammad Pourmojdeh, Alireza Bahremand, Hojjat allah Rezapour
IAU-Rasht Branch
Supervisor: Aref Safari Ph.D.
Spring 2019
Implementing The Genetic Algorithm in CPU and GPU
Table of Content
• Introduction to Evolutionary Computing
• Definition of Evolutionary Algorithms
• Components of Evolutionary Algorithms
• Review of Genetic Algorithm
• Implementation and Evaluation
• References
• Evolutionary Computing is a research area within computer science that transforms
computers into automatic optimization and design tools, utilizing the power of the
natural selection mechanisms.
• The contemporary terminology denotes the whole field by EC and the algorithms
involved are termed Evolutionary Algorithms.
Evolutionary Computing (EC)
3
1948
Genetical or evolutionary search
(Turing)
1962
Executed optimization
(Bremermann)
1965
Evolutionary Strategies
(Rechenberg, Schwefel)
1966
Evolutionary Programming
(Fogel)
1967
Genetic Algorithm
(Holland)
Evolutionary Algorithms (EA)
4
1992
Genetic Programming
(Koza)
1992
ACO Algorithm
(Dorigo)
1995
PSO Algorithm
(Kennedy and Eberhart)
Evolutionary Algorithms (EA)
5
• Algorithms that perform optimization or learning tasks with the ability to evolve.
• There are many different variants of evolutionary algorithms but the common
underlying idea behind all these techniques is the same.
3 main characteristics:
• Population-based • Fitness-oriented • Variation-driven
Evolutionary Algorithms (EA)
6
• GA came from the research of John Holland, in the University of Michigan.
• Main purpose is to be used to solve problems where deterministic algorithms are too costly.
• Travelling salesman problem or the knapsack problem fit the description.
Genetic Algorithm (GA)
7
Genetic Algorithm (GA)
8
INITIALISE population with random candidate solutions;
EVALUATE each candidate;
REPEAT UNTIL ( TERMINATION CONDITION is satisfied ) DO
I. SELECT parents;
II. RECOMBINE pairs of parents;
III. MUTATE the resulting offspring;
IV. EVALUATE new candidates;
V. SELECT individuals for the next generation;
END
• The first step is to decide how possible solutions should be specified and stored in
a way that can be manipulated by a computer.
• Objects forming possible solutions within the original problem context are referred
to as phenotypes and their encoding that is the individuals within the EA, are called
genotypes.
Representation
9
• The role of the evaluation function is to represent the requirements the population
should adapt to meet.
• More accurately, it defines what improvement means.
• Fitness Function is not a constant mathematical formula but changes with the
context of the problem.
Evaluation Function (Fitness Func.)
10
• The role of parent selection or mate selection is to distinguish among individuals
based on their quality and in particular to allow the better individuals to become
parents of the next generation.
• Roulette Wheel has one of the most uses in the genetic algorithm.
Parent Selection Mechanism
11
• This operator merges information from two parent genotypes into one or two
offspring genotypes.
• The role of recombination differs between EC dialects, For instance in genetic
programming it is often the only variation operator whereas in evolutionary
programming it is never used.
• Single Point • Multi Point • Uniform
Crossover
12
0 1 2 3 4 5 6 7 8 9
5 8 9 4 2 3 5 7 5 8
0 1 2 3 4 3 5 7 5 8
5 8 9 4 2 5 6 7 8 9
Selection Point could be anywhere in genotype
Recombination – Single Point
13
Parent A
Parent B
Offspring A
Offspring B
0 1 2 3 4 5 6 7 8 9
5 8 9 4 2 3 5 7 5 8
0 1 2 4 2 3 6 7 8 9
5 8 9 3 4 5 5 7 5 8
Selection Points could be anywhere in genotype
Recombination – Multi Point
14
Parent A
Parent B
Offspring A
Offspring B
0 1 2 3 4 5 6 7 8 9
5 8 9 4 2 3 5 7 5 8
5 1 9 4 4 5 5 7 5 9
0 8 2 3 2 3 6 7 8 8
Recombination – Uniform
15
Parent A
Parent B
Offspring A
Offspring B
• In simple terms, mutation may be defined as a small random tweak in the
chromosome, to get a new solution.
• Mutation is usually applied with a low probability because if the probability is very
high, the GA gets reduced to a random search.
0 0 1 1 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0
Mutation
16
• Similar to parent selection, the role of survivor selection or environmental selection is to
distinguish among individuals based on their quality, but In contrast to parent selection
which is typically stochastic, survivor selection is often deterministic.
• For example, two common methods are the fitness-based method of ranking the unified
multiset of parents and offspring and selecting the top segment, or the age-biased
approach of selecting only from the offspring.
Survivor Selection Mechanism (Replacement)
17
• The maximally allowed CPU time elapses.
• The total number of fitness evaluations reaches a given limit.
• The fitness improvement remains under a threshold value for a given period of time
• The population diversity drops under a given threshold.
Termination Condition
18
• A CPU is basically a microprocessor that executes instructions given by a program
based on operations for arithmetic, control, logic, and input-output.
• The fundamental components of a CPU include an arithmetic logic unit (ALU),
processor registers that provide operations to the ALU and store the results, a
control unit (CU) that executes instructions from memory, and various registers.
Central Processing Units (CPU)
19
Central Processing Units (CPU)
20
• A CPU is designed for low latency (quick response time) by implementing a large
cache that is used for intermediate storage to avoid reading from global memory,
which is very slow.
• Core’s concept
Central Processing Units (CPU)
21
• Originally, the GPU was made for rendering images in computer games and was optimized
for the fact that each pixel value can be processed independently from the others.
• Instead of focusing on low latency as a CPU does, a GPU focuses on high throughputs that
is, calculating on as much data as possible. Thus a GPU has more hardware allocated to
computation and less to fast cache memory, the opposite of a CPU.
Graphic Processing Unit (GPU)
22
• Another main difference between a CPU and a GPU is that a CPU has a few
powerful cores while a GPU has thousands of weaker cores.
• This gives the GPU an advantage in highly parallelizable applications, while the
CPU is better for sequential runs.
Graphic Processing Unit (GPU)
23
CPU architecture (to the left) and GPU architecture (to the right)
24
Code written for a CPU cannot be run on a GPU since the two platforms are based on different
hardware and thus require code specifically written for each specific platform. For NVIDIA
graphics cards the language is CUDA, which is accessible as a superset of C++, among others.
From a programmer’s perspective, CUDA code looks like normal C++ code, except that
functions are marked as being run able on CPU, GPU, or both.
Programming
25
The code run on the GPU is called a “kernel.” The difference from code run on the
CPU is that the each kernel will be executed by thousands, or even millions, of
threads.
The programmer can specify the number of blocks and the number of threads per
block to be run. The threads in a block will all run on the same core.
Programming
26
27
Programming
28
Implementation
References
• A.E. Eiben, J.E. Smith. Introduction to Evolutionary Computing, Second Edition. 2015
• Yu, Xinjie, Gen, Mitsuo. Introduction to Evolutionary Algorithms. 2010
• Adrian Horga. Genetic algorithms – CPU vs GPU implementation discussion, Metaheuristics course report.
•‫مرادی‬,،‫قیداری‬ ‫شیری‬ ‫سعید‬ ‫و‬ ‫سجاد‬۱۳۸۴،‫سازی‬ ‫بهینه‬‫یازدهمی‬ ،‫ژنتیکی‬ ‫های‬ ‫الگوریتم‬ ‫از‬ ‫استفاده‬ ‫با‬ ‫کلید‬ ‫صفحه‬ ‫روی‬ ‫بر‬ ‫فارسی‬ ‫حروف‬ ‫چینش‬‫ن‬
‫و‬ ‫نظری‬ ‫فیزیک‬ ‫تحقیقات‬ ‫مرکز‬ ،‫ایران‬ ‫کامپیوتر‬ ‫انجمن‬ ،‫تهران‬ ،‫ایران‬ ‫کامپیوتر‬ ‫انجمن‬ ‫ساالنه‬ ‫کنفرانس‬‫مخابرات‬
•‫یزد‬ ‫میبد‬ ‫واحد‬ ‫آزاد‬ ‫دانشگاه‬ ،‫آن‬ ‫های‬ ‫کاربرد‬ ‫و‬ ‫موازی‬ ‫ژنتیک‬ ‫الگوریتم‬ ،‫بافقی‬ ‫کارگران‬ ‫فاطمه‬ ،‫بدرآبادی‬ ‫میرزایی‬ ‫کمال‬ ،‫هاشمی‬ ‫محسن‬ ‫سید‬
•‫زیستی‬ ‫محاسبات‬ ‫نرم‬ ‫رایانش‬ ‫مبانی‬ ،‫ویسی‬ ‫هادی‬:‫تهران‬ ‫دانشگاه‬ ،‫تکاملی‬ ‫پردازش‬–‫نوین‬ ‫فنون‬ ‫و‬ ‫علوم‬ ‫دانشکده‬
Any Question?
E B R A Z

More Related Content

Similar to Genetic Algorithm Implementation on CPU and GPU

Approximation techniques used for general purpose algorithms
Approximation techniques used for general purpose algorithmsApproximation techniques used for general purpose algorithms
Approximation techniques used for general purpose algorithmsSabidur Rahman
 
Whitepaper: Where did my CPU go?
Whitepaper: Where did my CPU go?Whitepaper: Where did my CPU go?
Whitepaper: Where did my CPU go?Kristofferson A
 
Clustering using GA and Hill-climbing
Clustering using GA and Hill-climbingClustering using GA and Hill-climbing
Clustering using GA and Hill-climbingFatemeh Karimi
 
Preparing Fusion codes for Perlmutter - CGYRO
Preparing Fusion codes for Perlmutter - CGYROPreparing Fusion codes for Perlmutter - CGYRO
Preparing Fusion codes for Perlmutter - CGYROIgor Sfiligoi
 
In the age of Big Data, what role for Software Engineers?
In the age of Big Data, what role for Software Engineers?In the age of Big Data, what role for Software Engineers?
In the age of Big Data, what role for Software Engineers?CS, NcState
 
Toward Fine-Grained Online Task Characteristics Estimation in Scientific Work...
Toward Fine-Grained Online Task Characteristics Estimation in Scientific Work...Toward Fine-Grained Online Task Characteristics Estimation in Scientific Work...
Toward Fine-Grained Online Task Characteristics Estimation in Scientific Work...Rafael Ferreira da Silva
 
01 Programming for Problem Solving.pdf
01 Programming for Problem Solving.pdf01 Programming for Problem Solving.pdf
01 Programming for Problem Solving.pdfA2Zgameggc
 
Introduction to Problem Solving Techniques- Python
Introduction to Problem Solving Techniques- PythonIntroduction to Problem Solving Techniques- Python
Introduction to Problem Solving Techniques- PythonPriyankaC44
 
Mauricio breteernitiz hpc-exascale-iscte
Mauricio breteernitiz hpc-exascale-iscteMauricio breteernitiz hpc-exascale-iscte
Mauricio breteernitiz hpc-exascale-isctembreternitz
 
Early Successes Debugging with TotalView on the Intel Xeon Phi Coprocessor
Early Successes Debugging with TotalView on the Intel Xeon Phi CoprocessorEarly Successes Debugging with TotalView on the Intel Xeon Phi Coprocessor
Early Successes Debugging with TotalView on the Intel Xeon Phi CoprocessorIntel IT Center
 
Enhance similarity searching algorithm with optimized fast population count m...
Enhance similarity searching algorithm with optimized fast population count m...Enhance similarity searching algorithm with optimized fast population count m...
Enhance similarity searching algorithm with optimized fast population count m...IOSR Journals
 
Ml also helps generic compiler ?
Ml also helps generic compiler ?Ml also helps generic compiler ?
Ml also helps generic compiler ?Ryo Takahashi
 
Biology-Derived Algorithms in Engineering Optimization
Biology-Derived Algorithms in Engineering OptimizationBiology-Derived Algorithms in Engineering Optimization
Biology-Derived Algorithms in Engineering OptimizationXin-She Yang
 
Genetic Programming in Automated Test Code Generation
Genetic Programming in Automated Test Code GenerationGenetic Programming in Automated Test Code Generation
Genetic Programming in Automated Test Code GenerationDVClub
 
Challenges in Large Scale Machine Learning
Challenges in Large Scale  Machine LearningChallenges in Large Scale  Machine Learning
Challenges in Large Scale Machine LearningSudarsun Santhiappan
 
A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evolut...
 A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evolut... A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evolut...
A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evolut...AIRCC Publishing Corporation
 
A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evoluti...
A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evoluti...A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evoluti...
A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evoluti...AIRCC Publishing Corporation
 

Similar to Genetic Algorithm Implementation on CPU and GPU (20)

Approximation techniques used for general purpose algorithms
Approximation techniques used for general purpose algorithmsApproximation techniques used for general purpose algorithms
Approximation techniques used for general purpose algorithms
 
Whitepaper: Where did my CPU go?
Whitepaper: Where did my CPU go?Whitepaper: Where did my CPU go?
Whitepaper: Where did my CPU go?
 
Clustering using GA and Hill-climbing
Clustering using GA and Hill-climbingClustering using GA and Hill-climbing
Clustering using GA and Hill-climbing
 
Preparing Fusion codes for Perlmutter - CGYRO
Preparing Fusion codes for Perlmutter - CGYROPreparing Fusion codes for Perlmutter - CGYRO
Preparing Fusion codes for Perlmutter - CGYRO
 
Dl2 computing gpu
Dl2 computing gpuDl2 computing gpu
Dl2 computing gpu
 
In the age of Big Data, what role for Software Engineers?
In the age of Big Data, what role for Software Engineers?In the age of Big Data, what role for Software Engineers?
In the age of Big Data, what role for Software Engineers?
 
Toward Fine-Grained Online Task Characteristics Estimation in Scientific Work...
Toward Fine-Grained Online Task Characteristics Estimation in Scientific Work...Toward Fine-Grained Online Task Characteristics Estimation in Scientific Work...
Toward Fine-Grained Online Task Characteristics Estimation in Scientific Work...
 
01 Programming for Problem Solving.pdf
01 Programming for Problem Solving.pdf01 Programming for Problem Solving.pdf
01 Programming for Problem Solving.pdf
 
Introduction to Problem Solving Techniques- Python
Introduction to Problem Solving Techniques- PythonIntroduction to Problem Solving Techniques- Python
Introduction to Problem Solving Techniques- Python
 
Mauricio breteernitiz hpc-exascale-iscte
Mauricio breteernitiz hpc-exascale-iscteMauricio breteernitiz hpc-exascale-iscte
Mauricio breteernitiz hpc-exascale-iscte
 
Array Processor
Array ProcessorArray Processor
Array Processor
 
Early Successes Debugging with TotalView on the Intel Xeon Phi Coprocessor
Early Successes Debugging with TotalView on the Intel Xeon Phi CoprocessorEarly Successes Debugging with TotalView on the Intel Xeon Phi Coprocessor
Early Successes Debugging with TotalView on the Intel Xeon Phi Coprocessor
 
Enhance similarity searching algorithm with optimized fast population count m...
Enhance similarity searching algorithm with optimized fast population count m...Enhance similarity searching algorithm with optimized fast population count m...
Enhance similarity searching algorithm with optimized fast population count m...
 
Coa presentation4
Coa presentation4Coa presentation4
Coa presentation4
 
Ml also helps generic compiler ?
Ml also helps generic compiler ?Ml also helps generic compiler ?
Ml also helps generic compiler ?
 
Biology-Derived Algorithms in Engineering Optimization
Biology-Derived Algorithms in Engineering OptimizationBiology-Derived Algorithms in Engineering Optimization
Biology-Derived Algorithms in Engineering Optimization
 
Genetic Programming in Automated Test Code Generation
Genetic Programming in Automated Test Code GenerationGenetic Programming in Automated Test Code Generation
Genetic Programming in Automated Test Code Generation
 
Challenges in Large Scale Machine Learning
Challenges in Large Scale  Machine LearningChallenges in Large Scale  Machine Learning
Challenges in Large Scale Machine Learning
 
A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evolut...
 A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evolut... A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evolut...
A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evolut...
 
A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evoluti...
A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evoluti...A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evoluti...
A Comparative Evaluation of the GPU vs The CPU for Parallelization of Evoluti...
 

Recently uploaded

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
[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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Recently uploaded (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
[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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
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...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Genetic Algorithm Implementation on CPU and GPU

  • 1. Evolutionary Computing Technology Sina Mohammadi, Mohammad Pourmojdeh, Alireza Bahremand, Hojjat allah Rezapour IAU-Rasht Branch Supervisor: Aref Safari Ph.D. Spring 2019 Implementing The Genetic Algorithm in CPU and GPU
  • 2. Table of Content • Introduction to Evolutionary Computing • Definition of Evolutionary Algorithms • Components of Evolutionary Algorithms • Review of Genetic Algorithm • Implementation and Evaluation • References
  • 3. • Evolutionary Computing is a research area within computer science that transforms computers into automatic optimization and design tools, utilizing the power of the natural selection mechanisms. • The contemporary terminology denotes the whole field by EC and the algorithms involved are termed Evolutionary Algorithms. Evolutionary Computing (EC) 3
  • 4. 1948 Genetical or evolutionary search (Turing) 1962 Executed optimization (Bremermann) 1965 Evolutionary Strategies (Rechenberg, Schwefel) 1966 Evolutionary Programming (Fogel) 1967 Genetic Algorithm (Holland) Evolutionary Algorithms (EA) 4
  • 5. 1992 Genetic Programming (Koza) 1992 ACO Algorithm (Dorigo) 1995 PSO Algorithm (Kennedy and Eberhart) Evolutionary Algorithms (EA) 5
  • 6. • Algorithms that perform optimization or learning tasks with the ability to evolve. • There are many different variants of evolutionary algorithms but the common underlying idea behind all these techniques is the same. 3 main characteristics: • Population-based • Fitness-oriented • Variation-driven Evolutionary Algorithms (EA) 6
  • 7. • GA came from the research of John Holland, in the University of Michigan. • Main purpose is to be used to solve problems where deterministic algorithms are too costly. • Travelling salesman problem or the knapsack problem fit the description. Genetic Algorithm (GA) 7
  • 8. Genetic Algorithm (GA) 8 INITIALISE population with random candidate solutions; EVALUATE each candidate; REPEAT UNTIL ( TERMINATION CONDITION is satisfied ) DO I. SELECT parents; II. RECOMBINE pairs of parents; III. MUTATE the resulting offspring; IV. EVALUATE new candidates; V. SELECT individuals for the next generation; END
  • 9. • The first step is to decide how possible solutions should be specified and stored in a way that can be manipulated by a computer. • Objects forming possible solutions within the original problem context are referred to as phenotypes and their encoding that is the individuals within the EA, are called genotypes. Representation 9
  • 10. • The role of the evaluation function is to represent the requirements the population should adapt to meet. • More accurately, it defines what improvement means. • Fitness Function is not a constant mathematical formula but changes with the context of the problem. Evaluation Function (Fitness Func.) 10
  • 11. • The role of parent selection or mate selection is to distinguish among individuals based on their quality and in particular to allow the better individuals to become parents of the next generation. • Roulette Wheel has one of the most uses in the genetic algorithm. Parent Selection Mechanism 11
  • 12. • This operator merges information from two parent genotypes into one or two offspring genotypes. • The role of recombination differs between EC dialects, For instance in genetic programming it is often the only variation operator whereas in evolutionary programming it is never used. • Single Point • Multi Point • Uniform Crossover 12
  • 13. 0 1 2 3 4 5 6 7 8 9 5 8 9 4 2 3 5 7 5 8 0 1 2 3 4 3 5 7 5 8 5 8 9 4 2 5 6 7 8 9 Selection Point could be anywhere in genotype Recombination – Single Point 13 Parent A Parent B Offspring A Offspring B
  • 14. 0 1 2 3 4 5 6 7 8 9 5 8 9 4 2 3 5 7 5 8 0 1 2 4 2 3 6 7 8 9 5 8 9 3 4 5 5 7 5 8 Selection Points could be anywhere in genotype Recombination – Multi Point 14 Parent A Parent B Offspring A Offspring B
  • 15. 0 1 2 3 4 5 6 7 8 9 5 8 9 4 2 3 5 7 5 8 5 1 9 4 4 5 5 7 5 9 0 8 2 3 2 3 6 7 8 8 Recombination – Uniform 15 Parent A Parent B Offspring A Offspring B
  • 16. • In simple terms, mutation may be defined as a small random tweak in the chromosome, to get a new solution. • Mutation is usually applied with a low probability because if the probability is very high, the GA gets reduced to a random search. 0 0 1 1 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 Mutation 16
  • 17. • Similar to parent selection, the role of survivor selection or environmental selection is to distinguish among individuals based on their quality, but In contrast to parent selection which is typically stochastic, survivor selection is often deterministic. • For example, two common methods are the fitness-based method of ranking the unified multiset of parents and offspring and selecting the top segment, or the age-biased approach of selecting only from the offspring. Survivor Selection Mechanism (Replacement) 17
  • 18. • The maximally allowed CPU time elapses. • The total number of fitness evaluations reaches a given limit. • The fitness improvement remains under a threshold value for a given period of time • The population diversity drops under a given threshold. Termination Condition 18
  • 19. • A CPU is basically a microprocessor that executes instructions given by a program based on operations for arithmetic, control, logic, and input-output. • The fundamental components of a CPU include an arithmetic logic unit (ALU), processor registers that provide operations to the ALU and store the results, a control unit (CU) that executes instructions from memory, and various registers. Central Processing Units (CPU) 19
  • 21. • A CPU is designed for low latency (quick response time) by implementing a large cache that is used for intermediate storage to avoid reading from global memory, which is very slow. • Core’s concept Central Processing Units (CPU) 21
  • 22. • Originally, the GPU was made for rendering images in computer games and was optimized for the fact that each pixel value can be processed independently from the others. • Instead of focusing on low latency as a CPU does, a GPU focuses on high throughputs that is, calculating on as much data as possible. Thus a GPU has more hardware allocated to computation and less to fast cache memory, the opposite of a CPU. Graphic Processing Unit (GPU) 22
  • 23. • Another main difference between a CPU and a GPU is that a CPU has a few powerful cores while a GPU has thousands of weaker cores. • This gives the GPU an advantage in highly parallelizable applications, while the CPU is better for sequential runs. Graphic Processing Unit (GPU) 23
  • 24. CPU architecture (to the left) and GPU architecture (to the right) 24
  • 25. Code written for a CPU cannot be run on a GPU since the two platforms are based on different hardware and thus require code specifically written for each specific platform. For NVIDIA graphics cards the language is CUDA, which is accessible as a superset of C++, among others. From a programmer’s perspective, CUDA code looks like normal C++ code, except that functions are marked as being run able on CPU, GPU, or both. Programming 25
  • 26. The code run on the GPU is called a “kernel.” The difference from code run on the CPU is that the each kernel will be executed by thousands, or even millions, of threads. The programmer can specify the number of blocks and the number of threads per block to be run. The threads in a block will all run on the same core. Programming 26
  • 29. References • A.E. Eiben, J.E. Smith. Introduction to Evolutionary Computing, Second Edition. 2015 • Yu, Xinjie, Gen, Mitsuo. Introduction to Evolutionary Algorithms. 2010 • Adrian Horga. Genetic algorithms – CPU vs GPU implementation discussion, Metaheuristics course report. •‫مرادی‬,،‫قیداری‬ ‫شیری‬ ‫سعید‬ ‫و‬ ‫سجاد‬۱۳۸۴،‫سازی‬ ‫بهینه‬‫یازدهمی‬ ،‫ژنتیکی‬ ‫های‬ ‫الگوریتم‬ ‫از‬ ‫استفاده‬ ‫با‬ ‫کلید‬ ‫صفحه‬ ‫روی‬ ‫بر‬ ‫فارسی‬ ‫حروف‬ ‫چینش‬‫ن‬ ‫و‬ ‫نظری‬ ‫فیزیک‬ ‫تحقیقات‬ ‫مرکز‬ ،‫ایران‬ ‫کامپیوتر‬ ‫انجمن‬ ،‫تهران‬ ،‫ایران‬ ‫کامپیوتر‬ ‫انجمن‬ ‫ساالنه‬ ‫کنفرانس‬‫مخابرات‬ •‫یزد‬ ‫میبد‬ ‫واحد‬ ‫آزاد‬ ‫دانشگاه‬ ،‫آن‬ ‫های‬ ‫کاربرد‬ ‫و‬ ‫موازی‬ ‫ژنتیک‬ ‫الگوریتم‬ ،‫بافقی‬ ‫کارگران‬ ‫فاطمه‬ ،‫بدرآبادی‬ ‫میرزایی‬ ‫کمال‬ ،‫هاشمی‬ ‫محسن‬ ‫سید‬ •‫زیستی‬ ‫محاسبات‬ ‫نرم‬ ‫رایانش‬ ‫مبانی‬ ،‫ویسی‬ ‫هادی‬:‫تهران‬ ‫دانشگاه‬ ،‫تکاملی‬ ‫پردازش‬–‫نوین‬ ‫فنون‬ ‫و‬ ‫علوم‬ ‫دانشکده‬