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
1
vote
2 answers

DEAP evolutionary module, always evaluate entire population

I'm trying to solve a non-deterministic problem with DEAP. the problem is that the module only evaluate new chromosome and uses the score kept in memory for old ones. How can i set the module, so at each generation the ENTIRE population will be…
Guy Barash
  • 470
  • 5
  • 17
1
vote
0 answers

Python DEAP Multiprocessing example

I am looking to speed up my DEAP code using multiprocessing. (sample code in Unable to speed up Python DEAP with Multiprocessing Does anybody has a simple code which successfully speed up DEAP using multiprocessing? The only sample code which using…
ShanSu
  • 21
  • 3
1
vote
1 answer

Evaluate batch of individuals in Deap instead of one-by-one evaluation

I wonder if there is a way to evaluate batches of individuals when running deap ? The classic implementations evaluate individuals one by one but my evaluation function requires me to evaluate the inidviduals with a surrogate model that is only…
Charles
  • 21
  • 4
1
vote
1 answer

Unable to speed up Python DEAP with Multiprocessing

I am using the below sample code for OneMax problem (maximizing the number of ones of a bitstring) using DEAP package and multiprocessing. I am unable to speed up the process using multiprocessing. I want to use this for a more complex problem…
ShanSu
  • 21
  • 3
1
vote
1 answer

Visualizing nested function calls in python

I need a way to visualize nested function calls in python, preferably in a tree-like structure. So, if I have a string that contains f(g(x,h(y))), I'd like to create a tree that makes the levels more readable. For example: f() | …
Burnt Umber
  • 133
  • 1
  • 9
1
vote
1 answer

Sphinx autodoc does not display all types or circular import error

I am trying to auto document types with sphinx autodoc, napoleon and autodoc_typehints but I am having problems as it does not work with most of my types. I am using the deap package to do some genetic optimization algorithm, which makes that I have…
Thomas
  • 1,823
  • 1
  • 8
  • 24
1
vote
1 answer

Python DEAP and multiprocessing on Windows: AttributeError

I have the following situation: Windows 10 Python 3.7 deap 1.3.1 There is a main.py with def main(): ... schedule.schedule() ... if __name__== "__main__": main() Then, I also have a file schedule.py with def schedule() ... …
fpnick
  • 419
  • 2
  • 6
  • 18
1
vote
1 answer

python DEAP library Multiple Processors

I want to solve a multi-objective optimization problem using DEAP, a python based framework. Due to time consuming processes, i need to use all of my CPU power to compute. So i used multiprocessing library as suggested in DEAP documentation an this…
Sina_Alef
  • 31
  • 6
1
vote
2 answers

DEAP genetic program - crossover failed (incomplete tree)

I use deep to do the genetic programming. My individual is expression tree. I add some customized operator with arity 1 and 2. pset = gp.PrimitiveSet("MAIN", 7) pset.addPrimitive(operator.add, 2) pset.addPrimitive(operator.sub,…
1
vote
1 answer

How can I update or adjust the evaluation function after each generation in a DEAP genetic algorithm

I have made a genetic algorithm using DEAP package. My evaluation function looks like the following Arch = np.array([0,0,0,0,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0]) def evalComp(individual): compare = ((np.absolute( Arch[3] -…
badam
  • 55
  • 4
1
vote
1 answer

DEAP: create individual with certain values

I have a DEAP toolbox setup import random from deap import base, tools, creator, algorithms toolbox = base.Toolbox() creator.create("FitnessMax", base.Fitness, weights=(1.0,)) creator.create("Individual", list,…
usernumber
  • 1,958
  • 1
  • 21
  • 58
1
vote
1 answer

DEAP: sorting individuals by fitness

What is the best way to sort a population by individual fitness where the fitness of each individual has been evaluated? I implemented a sorting function by hand, but perhaps there is a built-in way to do this? import random from deap import base,…
usernumber
  • 1,958
  • 1
  • 21
  • 58
1
vote
1 answer

DEAP: make fitness of an individual depend on entire population

To implement a sharing strategy (described here), the fitness function needs to depend on other individuals in the population. def shared_fitness(individual, population): #compute return result How do I register this function in a toolbox…
usernumber
  • 1,958
  • 1
  • 21
  • 58
1
vote
2 answers

Is it possible to get algorithm.eaSimple to return a logbook that includes all stats from run time?

I want to be able to get all my statistics out of the logbook so I can use it for graphical representation. As it stands my logbook only contains the generation numbers and number of evaluations. The algorithm is calculating and outputting avg, std,…
1
vote
1 answer

Can DEAP be used for multimodal optimization?

From browsing the documentation and examples (here, here, here) for DEAP, I found a few instances of using DEAP for multi-objective optimization, but nothing on multi-modal optimization. Is it possible to use the DEAP framework for evolutionary…