Skip to content

Latest commit

 

History

History
104 lines (75 loc) · 5.02 KB

pyevolve.md

File metadata and controls

104 lines (75 loc) · 5.02 KB

##The DIY Guide to PyEvolve

Analytics

Please make Pull Requests for good resources, or create Issues for any feedback! Thanks!


###Table Of Contents


PyEvolve is a genetic algorithm library, which is a biologically-inspired optimization technique. This library enables us to solve search problems such as hyperparameter tuning.

###Learn By Example The goal of this section is to get you hands on ASAP. If the hello world example confuses you, try out the theory section first.

pip install pyevolve

#####Hello World

  • Define an eval function to calculate fitness
  • Genome defines the encoding, initialization, mutation, crossover of the population
  • GA assigns the search hyperparameters such as generations, mutation rate and crossover rate

#####Interactive Mode

  • Visualizations of population and fitness
  • Does not work on Macs, workaround

#####More Parameters

  • Changed the range of the genomes here
  • Gaussian mutator example here
  • Selection algorithm is changed as well here

#####Harder Search Problem

#####Maximize to Minimize

  • Minimize instead of maximize here
  • Scaling the fitness scores to better distinguish the good from the bad here

#####Callback

  • Callback is called after every generation here
  • Good for logging statistics of the population

#####2D Problem Example

  • Good for grid search problems such as the N-Queen problem

#####1D Binary String Example

  • An extreme case for the normal G1DList
  • Useful for binary string problems

#####Allele Example

  • Alleles are designed for discrete and categorical data instead of real and continuous data
  • Categorical data example here

#####Genetic Programming Example

  • Genetic programming is a branch of genetic algorithms
  • Computer programs are encoded as a set of genes that are then modified to produce a target output

###Theory The goal of this section is to explain the background behind the package

#####Genetic Algorithm

#####Encoding

#####Selector

#####Mutator & Crossover

#####Genetic Programming


###Documentation The goal of this section is to reference more parameters and implementation details