Questions tagged [deap]

DEAP is an evolutionary computation framework for rapid prototyping and testing of ideas

DEAP is a novel evolutionary computation framework for rapid prototyping and testing of ideas. It seeks to make algorithms explicit and data structures transparent. It works in perfect harmony with parallelisation mechanism such as multiprocessing and SCOOP.

Features:

  • Genetic algorithm using any imaginable representation
  • List, Array, Set, Dictionary, Tree, Numpy Array, etc.
  • Genetic programing using prefix trees
  • Loosely typed, Strongly typed
  • Automatically defined functions
  • Evolution strategies (including CMA-ES)
  • Multi-objective optimisation (NSGA-II, SPEA-II)
  • Co-evolution (cooperative and competitive) of multiple populations
  • Parallelization of the evaluations (and more)
  • Hall of Fame of the best individuals that lived in the population
  • Checkpoints that take snapshots of a system regularly
  • Benchmarks module containing most common test functions
  • Genealogy of an evolution (that is compatible with NetworkX)
  • Examples of alternative algorithms: Particle Swarm Optimization, Differential Evolution, - Estimation of Distribution Algorithm
173 questions
11
votes
4 answers

how to minimize a function using Deap?

I need to minimize a function using genetic algorithm and PSO. Different posts suggest to use DEAP (I am using python) but I do not even understand how to start. We can consider for example f on the interval i i=arange(-10,10,0.1) def f(x): …
Donbeo
  • 17,067
  • 37
  • 114
  • 188
9
votes
1 answer

python DEAP genetic algorithm multi-core speed

I am using Python's DEAP pacakge and I want to multi-core my code and I used the tutorial at http://deap.gel.ulaval.ca/doc/dev/tutorials/distribution.html to successfully do it using multiprocessing. My question is the following: using 8 cores, how…
newmathwhodis
  • 3,209
  • 2
  • 24
  • 26
7
votes
1 answer

What's the importance of invalid fitness in DEAP?

I am just starting use DEAP. Previously, I used GA based on Matlab that after crossover and mutation is to select the better individuals with specified size, and then updating the population. But it is quite hard for me to understand that why in…
Zhida Deng
  • 189
  • 2
  • 12
7
votes
2 answers

Python CMA-ES Algorithm to solve user-defined function and constraints

I am struggling to create a simple example of a CMA-ES optimization algorithm in python. What is the most streamlined way to optimize the function x**2 + 2*y**2 -4*x*y - 0.5*y, subject to constraints -2
kilojoules
  • 9,768
  • 18
  • 77
  • 149
7
votes
4 answers

Python: networkx: How to make node size auto-expand to fit the label

I'm using this bit of code from a deap symbolic regression example problem and the graph displays fine but I want the nodes to expand as rounded rectangles to fit the text automatically. (I don't want to just specify the node size through trial and…
user2514676
  • 473
  • 2
  • 6
  • 18
5
votes
1 answer

DEAP toolbox: to consider different types and ranges of genes in mutation and crossover operators

I am working on a genetic algorithm implementation and I'm using DEAP toolbox. I've written a code that initializes chromosomes which their first gene is a float number in range of [0.01, 2048], their second gene is again float in range of [0.0001,…
Saeide
  • 149
  • 2
  • 14
5
votes
1 answer

Deap python package: create individuals with different ranges and mix of integers and floats

I am trying to use DEAP to maximise a function. I understand how to do it with the basic example: toolbox.register("attr_bool", random.randint, 0, 1) toolbox.register("individual", tools.initRepeat, creator.Individual, toolbox.attr_bool,…
azuric
  • 2,679
  • 7
  • 29
  • 44
4
votes
1 answer

Python genetic optimisation multiprocessing with a global constant variable, how to speed up?

I am writing a genetic optimization algorithm based on the deap package in python 2.7 (goal is to migrate to python 3 soon). As it is a pretty heavy process, some parts of the optimisation are processed using the multiprocessing package. Here is a…
Thomas
  • 1,823
  • 1
  • 8
  • 24
4
votes
0 answers

use SCOOP from inside a Jupyter notebook

I'm learning deap and I want to use scoop. Is it possible to test my programs in a notebook? I learned from scoop documentation that $ python -m scoop your_program.py is the right way to run. Is there any way I can pass '-m scoop' as argument to…
4
votes
1 answer

Python DEAP - Custom fitness function

My question is about the possibility to implement a custom fitness function in DEAP/Python in my Genetic Programming implementation. After search and reading DEAP official documentation, i don't find anything about it, so, if one of you could help…
4
votes
1 answer

Programming DEAP with Scoop

I'm using the DEAP library in python for a multi-objective optimization problem. I'd like to use multiple processors for this task; however, I'm running into some trouble. To give some context, I'm using networkx in conjunction with DEAP I also…
meraxes
  • 541
  • 10
  • 23
4
votes
2 answers

How to fix "gp.generate tried to add a primitive but there is none available"?

I'm trying to construct a typed genetic programming solution with DEAP. I start the program with a photo of a black & white triangle and the 3 vertices of a different triangle. The hope is for the program to come up with a program which moves the…
John Mee
  • 50,179
  • 34
  • 152
  • 186
4
votes
2 answers

Deap: Want to know the generation that created the best individual

I'm running a genetic algorithm program and can find the best individual at the end of the run (hof[0]), but i want to know which generation produced it. Is there any attributes of hof[0] that will help print the individual and the generation that…
3
votes
2 answers

How can I select features for Symbolic Regression

How can I select features for Symbolic Regression ? I have 30 features, I want to use only the most sensitive features for Symbolic Regression. As an example, this dataset can be used which is similar to my dataset.…
Roman
  • 3,007
  • 8
  • 26
  • 54
3
votes
1 answer

DEAP: make mutation probability depend on generation number

I am using a genetic algorithm implemented with the DEAP library for Python. In order to avoid premature convergence, and to force exploration of the feature space, I would like the mutation probability to be high during the first generations. But…
usernumber
  • 1,958
  • 1
  • 21
  • 58
1
2 3
11 12