All Projects → StefanoFioravanzo → MAP-Elites

StefanoFioravanzo / MAP-Elites

Licence: other
Python implementation of the genetic algorithm MAP-Elites with applications in constrained optimization

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to MAP-Elites

GeneticAlgorithmForFeatureSelection
Search the best feature subset for you classification mode
Stars: ✭ 82 (+115.79%)
Mutual labels:  genetic-programming, evolutionary-algorithms
SimpleGP
Simple Genetic Programming for Symbolic Regression in Python3
Stars: ✭ 20 (-47.37%)
Mutual labels:  genetic-programming, evolutionary-algorithms
tiny gp
Tiny Genetic Programming in Python
Stars: ✭ 58 (+52.63%)
Mutual labels:  genetic-programming, evolutionary-algorithms
vita
Vita - Genetic Programming Framework
Stars: ✭ 24 (-36.84%)
Mutual labels:  genetic-programming, evolutionary-algorithms
FEDOT
Automated modeling and machine learning framework FEDOT
Stars: ✭ 312 (+721.05%)
Mutual labels:  genetic-programming, evolutionary-algorithms
rBAS
Implementation of the (beetle antennae search) BAS algorithm and its mutations in R code
Stars: ✭ 25 (-34.21%)
Mutual labels:  constrained-optimization
ruck
🧬 Modularised Evolutionary Algorithms For Python with Optional JIT and Multiprocessing (Ray) support. Inspired by PyTorch Lightning
Stars: ✭ 50 (+31.58%)
Mutual labels:  evolutionary-algorithms
slsqp
Modern Fortran Edition of the SLSQP Optimizer
Stars: ✭ 57 (+50%)
Mutual labels:  constrained-optimization
pdfo
Powell's Derivative-Free Optimization solvers
Stars: ✭ 56 (+47.37%)
Mutual labels:  constrained-optimization
helisa
Scala API for jenetics
Stars: ✭ 23 (-39.47%)
Mutual labels:  genetic-programming
Hypernets
A General Automated Machine Learning framework to simplify the development of End-to-end AutoML toolkits in specific domains.
Stars: ✭ 221 (+481.58%)
Mutual labels:  evolutionary-algorithms
moses
MOSES Machine Learning: Meta-Optimizing Semantic Evolutionary Search. See also AS-MOSES https://github.com/opencog/asmoses but kept to guaranty backward compatibility.
Stars: ✭ 127 (+234.21%)
Mutual labels:  genetic-programming
open-box
Generalized and Efficient Blackbox Optimization System [SIGKDD'21].
Stars: ✭ 174 (+357.89%)
Mutual labels:  constrained-optimization
machine-learning-blackjack-solution
Finding an optimal Blackjack strategy using AI
Stars: ✭ 40 (+5.26%)
Mutual labels:  evolutionary-algorithms
Metaheuristics.jl
High-performance metaheuristics for optimization coded purely in Julia.
Stars: ✭ 144 (+278.95%)
Mutual labels:  constrained-optimization
open-box
Generalized and Efficient Blackbox Optimization System.
Stars: ✭ 64 (+68.42%)
Mutual labels:  constrained-optimization
Moo-GBT
Library for Multi-objective optimization in Gradient Boosted Trees
Stars: ✭ 63 (+65.79%)
Mutual labels:  constrained-optimization
LifeEngine
The Life Engine
Stars: ✭ 274 (+621.05%)
Mutual labels:  evolutionary-algorithms
datafsm
Machine Learning Finite State Machine Models from Data with Genetic Algorithms
Stars: ✭ 14 (-63.16%)
Mutual labels:  evolutionary-algorithms
Optimized-MDVRP
"Using Genetic Algorithms for Multi-depot Vehicle Routing" paper implementation.
Stars: ✭ 30 (-21.05%)
Mutual labels:  evolutionary-algorithms

MAP-Elites for Constrained Optimization

Python implementation of the MAP Elites algorithm (originally devised for unconstrained optimization), for constrained optimization problems. More details can be found in our original GECCO paper and its extended arXiv version.

Implementation

.
├── controller.py
├── map_elites
│   ├── mapelites.py
│   ├── plot_utils.py
│   └── ea_operators.py
├── functions.py
├── config.ini
├── mapelites_continuous_opt.py
├── notebooks
│   ├── plotter.ipynb
│   └── n_dim_plotter.ipynb
└── utils
    └── fcnsuite.c

The algorithm is implemented to be as general as possible and applicable to any setting. The main MAPElites class in mapelites.py is an abstract class implementing all the base logic common to any instance of the algorithm.
To run the algorithm you need to subclass MapElites and implement map_x_to_b(), performance_measure(), generate_random_solution(), generate_feature_dimensions(). Refer to the functions documentation and the example below for more details.

MAP-Elites was designed to have a visual impact by showing its results in a heatmap plot in the feature dimensions. This implementation supports up to 4 dimensional heatmap plotting, with nested dimensions in the same plot. Refer to the plot_heatmap() function in plot_utils.py for more details.

Crossover and mutation evolutionary operators are implemented in ea_operators.py, you can extend that source file to add more custom evolutionary operators.

Configuration

All the configuration can be done using the config.ini file provided at the root of the project. Here is an example configuration file:

[mapelites]
; random seed
seed = 54
; number of initial random samples
bootstrap_individuals = 100
; numer of map elites iterations
iterations = 10000
; True: solve a minimization problem. False: solve a maximization problem
minimization = True

[opt_function]
; Define the optimization function.
; This must be the name of a class subclassing the abstract class ConstrainedFunction. See functions.py for reference
name = C16
; Number of dimensions of the optimization function
dimensions = 4
; Define heatmap bins for feature dimensions
; Name each bin as `bin_{name of constraint}` where `name_of_constraint` is the name of the constraint
; function implemented in the specified optimization function class
; If you want to define ONE bin for all constraints, name it `bin_all`
; Note: The bins must be defined by numbers, except for the `inf` label which can be defined ether at the beginning
; of at the end of the bins.
; bin_all = inf,0.0,1.0,2.0,3.0,4.0,inf
bin_g1 = inf,0.0,1.0,2.0,3.0,4.0,inf
bin_g2 = inf,0.0,1.0,2.0,3.0,inf
bin_h1 = inf,0.0,1.0,2.0,3.0,4.0,5.0,inf
bin_h2 = inf,0.0,1.0,2.0,inf

[crossover]
; Crossover function taken from ea_operators.py file.
; Name of called function is {type}_crossover(). If `type = UNIFORM` then the function call is `uniform_crossover()`
type = UNIFORM
; list of arguments to the above function
indpb = 0.5

[mutation]
; mutation function taken from ea_operators.py file.
; name of called function is {type}_mutation(). If `type = GAUSSIAN` then the function call is `gaussian_mutation()`
type = GAUSSIAN
; Define how to manage the boundaries during mutation, meaning how the algorithm should behave in case it mutates outside of the function domain.
; There are three possible cases:
; - `saturation`: x in [a,b], if after mutation x>b -> x=b; if x<a -> x=a
; - `bounce`: if x is mutated outside [a, b] it is bounced back by the remaining delta
; - `toroidal`: if x is mutated outside [a, b], x is bounced to the other bound by the remaining delta, 'pac-man' style
boundary = saturation
; list of arguments to the above function
mu = 0
sigma = 0.2
; probability of each attribute to be mutated
indpb = 0.5

Example: Continuous Constrained Optimization

In this project we extended the core MAP-Elites algorithm to solve continuous constrained optimization problem. Specifically, the problem setting is defined by an objective function subject to some constraints, some examples here.

Reference

If you use this code (or any modified version of it), please add the following reference:

Stefano Fioravanzo and Giovanni Iacca. 2019. Evaluating MAP-Elites
on constrained optimization problems. In Proceedings of the Genetic 
and Evolutionary Computation Conference Companion (GECCO '19). 
Association for Computing Machinery, New York, NY, USA, 253–254. 
DOI:https://doi.org/10.1145/3319619.3321939

@inproceedings{fioravanzo2019evaluating,
  title={Evaluating MAP-Elites on Constrained Optimization Problems},
  author={Fioravanzo, Stefano and Iacca, Giovanni},
  booktitle={Genetic and Evolutionary Computation Conference Companion},
  pages={253--254},
  year={2019},
  organization={ACM}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].