Skip to content

ahmadmoawad/Genetic-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Genetic Algorithms GA class

This repository contains the practical for the Genetic Algorithms (GA) class

hello_genetic Python

What is Genetic Algorithms (GA)

  • Method used in artificial intelligence and computing

  • Used for finding optimized solutions to search problems based on the theory of natural selection and evolutionary biology

  • Genetic algorithms are excellent for searching through large and complex data sets

  • Is a model or abstraction of biological evolution based on Charles Darwin's theory of natural selection Developed by John Holland in the 1960s and 1970s

John Holland

Advantages and Disadvantages of Genetic Algorithms (GA)

  • Advantages of GA:
  1. Parallelism
  2. Handles large, poorly understood search spaces easily
  3. Easy to discover global optimum
  4. Resistant to becoming trapped in local optima
  5. Good for multi-modal problems Returns a suite of solutions
  • Disadvantages of GA:
  1. Identifying fitness function
  2. Definition of representation for the problem
  3. The problem of choosing the various parameters like the size of the population, mutation rate, cross over rate, the selection method and its strength.
  4. Cannot use gradients
  5. No effective terminator
  6. Require large number of response (fitness) function evaluations

Application of Genetic Algorithms (GA)

  1. Design Neural networks both architecture and weights
  2. Traveling salesman problem TSP
  3. Scheduling
  4. Network design and routing i.e Network routing
  5. Signal processing (filter design)

AI vs. Machine Learning vs. Neural Networks vs. Deep Learning vs. Genetic Genetic Algorithms

ai subsets

Artificial Intelligence

Mimics cognitive functions that humans associate with other human minds, such as learning and problem solving

Machine Learning

Subset of AI that includes algorithms that parse data, learn from that data, and then apply what they’ve learned to make informed decisions:

  1. Supervised learning: learn to predicate outcomes with help from data scientists
  2. Unsupervised learning: machine learn to predicate outcomes on there go by recognizing patterns in input data when machines can draw meaningful inferences from large volumes of data set they demonstrate the ability to learn deeply

Neural Networks

Mimic the human brain through an artificial neural networks. Contains nodes in different layers that are connected and communicate with each other to make sense of voluminous input data. Number of hidden layers are small usually 1-3 layers and more than that consider DL architecture

Deep Learning

Subset of machine learning in which multilayered neural networks learn from vast amounts of data and the difference between DL and NN that DL contains many hidden layers

Genetic Algorithms

Method used in artificial intelligence and computing used for finding optimized (maximum or minimum) solutions to search problems based on the theory of natural selection and evolutionary biology


Environment Setup

  1. Python-3
  2. Anaconda (Optional)
  3. PyGad

For code editor you can use:

  1. VS Code
  2. Jupter
  3. Google Colab https://colab.research.google.com

Technologies

Some solutions are using libraries like PyGad while others not (Pure Python implementation). Some problems' solutions are both using libraries and Pure Python.

PyGad (Genetic Python library) ReadME-PyGad

Problems

  1. Linear Model
  2. Max Square function
  3. Traveling salesman problem (TSP)
  4. Simple Linear Regression
  5. Minimize function

GA Patterns

The pattern for any GA are theses steps:

  1. Define input(s)
  2. Define output
  3. Encoding type
  4. Fitness function
  5. Crossover and/or mutation
  6. Termination

Crossover types

Todo

Mutation types

Todo

About

Genetic Algorithm Codes, etc..

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages