DEAP (software)

Last updated
DEAP
Original author(s) François-Michel De Rainville, Félix-Antoine Fortin, Marc-André Gardner, Marc Parizeau, Christian Gagné
Developer(s) François-Michel De Rainville, Félix-Antoine Fortin, Marc-André Gardner
Initial release2009 (2009)
Stable release
1.4.1 [1]   OOjs UI icon edit-ltr-progressive.svg / 21 July 2023;12 months ago (21 July 2023)
Repository
Written in Python
Operating system Cross-platform
Type Evolutionary computation framework
License LGPL
Website github.com/deap

Distributed Evolutionary Algorithms in Python (DEAP) is an evolutionary computation framework for rapid prototyping and testing of ideas. [2] [3] [4] It incorporates the data structures and tools required to implement most common evolutionary computation techniques such as genetic algorithm, genetic programming, evolution strategies, particle swarm optimization, differential evolution, traffic flow [5] and estimation of distribution algorithm. It is developed at Université Laval since 2009.

Contents

Example

The following code gives a quick overview how the Onemax problem optimization with genetic algorithm can be implemented with DEAP.

importarrayimportrandomfromdeapimportcreator,base,tools,algorithmscreator.create("FitnessMax",base.Fitness,weights=(1.0,))creator.create("Individual",array.array,typecode='b',fitness=creator.FitnessMax)toolbox=base.Toolbox()toolbox.register("attr_bool",random.randint,0,1)toolbox.register("individual",tools.initRepeat,creator.Individual,toolbox.attr_bool,100)toolbox.register("population",tools.initRepeat,list,toolbox.individual)evalOneMax=lambdaindividual:(sum(individual),)toolbox.register("evaluate",evalOneMax)toolbox.register("mate",tools.cxTwoPoint)toolbox.register("mutate",tools.mutFlipBit,indpb=0.05)toolbox.register("select",tools.selTournament,tournsize=3)population=toolbox.population(n=300)NGEN=40forgeninrange(NGEN):offspring=algorithms.varAnd(population,toolbox,cxpb=0.5,mutpb=0.1)fits=toolbox.map(toolbox.evaluate,offspring)forfit,indinzip(fits,offspring):ind.fitness.values=fitpopulation=offspring

See also

Related Research Articles

In artificial intelligence, genetic programming (GP) is a technique of evolving programs, starting from a population of unfit programs, fit for a particular task by applying operations analogous to natural genetic processes to the population of programs.

<span class="mw-page-title-main">Genetic algorithm</span> Competitive algorithm for searching a problem space

In computer science and operations research, a genetic algorithm (GA) is a metaheuristic inspired by the process of natural selection that belongs to the larger class of evolutionary algorithms (EA). Genetic algorithms are commonly used to generate high-quality solutions to optimization and search problems by relying on biologically inspired operators such as mutation, crossover and selection. Some examples of GA applications include optimizing decision trees for better performance, solving sudoku puzzles, hyperparameter optimization, causal inference, etc.

In computational intelligence (CI), an evolutionary algorithm (EA) is a subset of evolutionary computation, a generic population-based metaheuristic optimization algorithm. An EA uses mechanisms inspired by biological evolution, such as reproduction, mutation, recombination, and selection. Candidate solutions to the optimization problem play the role of individuals in a population, and the fitness function determines the quality of the solutions. Evolution of the population then takes place after the repeated application of the above operators.

<span class="mw-page-title-main">Evolutionary computation</span> Trial and error problem solvers with a metaheuristic or stochastic optimization character

In computer science, evolutionary computation is a family of algorithms for global optimization inspired by biological evolution, and the subfield of artificial intelligence and soft computing studying these algorithms. In technical terms, they are a family of population-based trial and error problem solvers with a metaheuristic or stochastic optimization character.

NeuroEvolution of Augmenting Topologies (NEAT) is a genetic algorithm (GA) for the generation of evolving artificial neural networks developed by Kenneth Stanley and Risto Miikkulainen in 2002 while at The University of Texas at Austin. It alters both the weighting parameters and structures of networks, attempting to find a balance between the fitness of evolved solutions and their diversity. It is based on applying three key techniques: tracking genes with history markers to allow crossover among topologies, applying speciation to preserve innovations, and developing topologies incrementally from simple initial structures ("complexifying").

A fitness function is a particular type of objective function that is used to summarise, as a single figure of merit, how close a given design solution is to achieving the set aims. Fitness functions are used in software architecture and evolutionary algorithms (EA), such as genetic programming and genetic algorithms to guide simulations towards optimal design solutions.

In genetic algorithms and evolutionary computation, crossover, also called recombination, is a genetic operator used to combine the genetic information of two parents to generate new offspring. It is one way to stochastically generate new solutions from an existing population, and is analogous to the crossover that happens during sexual reproduction in biology. Solutions can also be generated by cloning an existing solution, which is analogous to asexual reproduction. Newly generated solutions may be mutated before being added to the population.

Mutation is a genetic operator used to maintain genetic diversity of the chromosomes of a population of a genetic or, more generally, an evolutionary algorithm (EA). It is analogous to biological mutation.

In evolutionary biology, inclusive fitness is one of two metrics of evolutionary success as defined by W. D. Hamilton in 1964:

Interactive evolutionary computation (IEC) or aesthetic selection is a general term for methods of evolutionary computation that use human evaluation. Usually human evaluation is necessary when the form of fitness function is not known or the result of optimization should fit a particular user preference.

In computer programming, gene expression programming (GEP) is an evolutionary algorithm that creates computer programs or models. These computer programs are complex tree structures that learn and adapt by changing their sizes, shapes, and composition, much like a living organism. And like living organisms, the computer programs of GEP are also encoded in simple linear chromosomes of fixed length. Thus, GEP is a genotype–phenotype system, benefiting from a simple genome to keep and transmit the genetic information and a complex phenotype to explore the environment and adapt to it.

Selection is the stage of a genetic algorithm or more general evolutionary algorithm in which individual genomes are chosen from a population for later breeding. Selection mechanisms are also used to choose candidate solutions (individuals) for the next generation. Retaining the best individuals in a generation unchanged in the next generation, is called elitism or elitist selection. It is a successful (slight) variant of the general process of constructing a new population.

In natural evolution and artificial evolution the fitness of a schema is rescaled to give its effective fitness which takes into account crossover and mutation.

In evolutionary algorithms (EA), the term of premature convergence means that a population for an optimization problem converged too early, resulting in being suboptimal. In this context, the parental solutions, through the aid of genetic operators, are not able to generate offspring that are superior to, or outperform, their parents. Premature convergence is a common problem found in evolutionary algorithms in general and genetic algorithms in particular, as it leads to a loss, or convergence of, a large number of alleles, subsequently making it very difficult to search for a specific gene in which the alleles were present. An allele is considered lost if, in a population, a gene is present, where all individuals are sharing the same value for that particular gene. An allele is, as defined by De Jong, considered to be a converged allele, when 95% of a population share the same value for a certain gene.

A memetic algorithm (MA) in computer science and operations research, is an extension of the traditional genetic algorithm (GA) or more general evolutionary algorithm (EA). It may provide a sufficiently good solution to an optimization problem. It uses a suitable heuristic or local search technique to improve the quality of solutions generated by the EA and to reduce the likelihood of premature convergence.

Cultural algorithms (CA) are a branch of evolutionary computation where there is a knowledge component that is called the belief space in addition to the population component. In this sense, cultural algorithms can be seen as an extension to a conventional genetic algorithm. Cultural algorithms were introduced by Reynolds (see references).

In computer science and operations research, the bees algorithm is a population-based search algorithm which was developed by Pham, Ghanbarzadeh et al. in 2005. It mimics the food foraging behaviour of honey bee colonies. In its basic version the algorithm performs a kind of neighbourhood search combined with global search, and can be used for both combinatorial optimization and continuous optimization. The only condition for the application of the bees algorithm is that some measure of distance between the solutions is defined. The effectiveness and specific abilities of the bees algorithm have been proven in a number of studies.

Universal Darwinism, also known as generalized Darwinism, universal selection theory, or Darwinian metaphysics, is a variety of approaches that extend the theory of Darwinism beyond its original domain of biological evolution on Earth. Universal Darwinism aims to formulate a generalized version of the mechanisms of variation, selection and heredity proposed by Charles Darwin, so that they can apply to explain evolution in a wide variety of other domains, including psychology, linguistics, economics, culture, medicine, computer science, and physics.

<span class="mw-page-title-main">Symbolic regression</span> Type of regression analysis

Symbolic regression (SR) is a type of regression analysis that searches the space of mathematical expressions to find the model that best fits a given dataset, both in terms of accuracy and simplicity.

The population model of an evolutionary algorithm (EA) describes the structural properties of its population to which its members are subject. A population is the set of all proposed solutions of an EA considered in one iteration, which are also called individuals according to the biological role model. The individuals of a population can generate further individuals as offspring with the help of the genetic operators of the procedure.

References

  1. "Release 1.4.1". 21 July 2023. Retrieved 30 July 2023.
  2. Fortin, Félix-Antoine; F.-M. De Rainville; M-A. Gardner; C. Gagné; M. Parizeau (2012). "DEAP: Evolutionary Algorithms Made Easy". Journal of Machine Learning Research. 13: 2171–2175.
  3. De Rainville, François-Michel; F.-A Fortin; M-A. Gardner; C. Gagné; M. Parizeau (2014). "DEAP: Enabling Nimber Evolutionss" (PDF). ACM SIGEVOlution. 6 (2): 17–26. doi:10.1145/2597453.2597455. S2CID   14949980.
  4. De Rainville, François-Michel; F.-A Fortin; M-A. Gardner; C. Gagné; M. Parizeau (2012). "DEAP: A Python Framework for Evolutionary Algorithms" (PDF). In Companion Proceedings of the Genetic and Evolutionary Computation Conference.
  5. "Creation of one algorithm to manage traffic systems". Social Impact Open Repository. Archived from the original on 2017-09-05. Retrieved 2017-09-05.