A Python Library for Quality-Diversity and NeuroEvolution
Project description
QDax: Accelerated Quality-Diversity
QDax is a tool to accelerate Quality-Diversity (QD) and neuro-evolution algorithms through hardware accelerators and massive parallelization. QD algorithms usually take days/weeks to run on large CPU clusters. With QDax, QD algorithms can now be run in minutes! ⏩ ⏩ 🕛
QDax has been developed as a research framework: it is flexible and easy to extend and build on and can be used for any problem setting. Get started with simple example and run a QD algorithm in minutes here!
- QDax paper
- QDax documentation
Installation
The latest stable release of QDax can be installed directly from source with:
pip install qdax
However, we also provide and recommend using either Docker, Singularity or conda environments to use the repository. Detailed steps to do so are available in the documentation.
Basic API Usage
For a full and interactive example to see how QDax works, we recommend starting with the tutorial-style Colab notebook. It is an example of the MAP-Elites algorithm used to evolve a population of controllers on a chosen Brax environment (Walker by default).
However, a summary of the main API usage is provided below:
import qdax
from qdax.core.map_elites import MAPElites
# Instantiate MAP-Elites
map_elites = MAPElites(
scoring_function=scoring_fn,
emitter=mixing_emitter,
metrics_function=metrics_function,
)
# Initializes repertoire and emitter state
repertoire, emitter_state, random_key = map_elites.init(init_variables, centroids, random_key)
# Run MAP-Elites loop
for i in range(num_iterations):
(repertoire, emitter_state, metrics, random_key,) = map_elites.update(
repertoire,
emitter_state,
random_key,
)
# Get contents of repertoire
repertoire.genotypes, repertoire.fitnesses, repertoire.descriptors
QDax core algorithms
QDax currently supports the following algorithms:
Algorithm | Example |
---|---|
MAP-Elites | |
CVT MAP-Elites | |
Policy Gradient Assisted MAP-Elites (PGA-ME) | |
OMG-MEGA | |
CMA-MEGA | |
Multi-Objective Quality-Diversity (MOME) |
QDax baseline algorithms
The QDax library also provides implementations for some useful baseline algorithms:
Algorithm | Example |
---|---|
DIAYN | |
DADS | |
SMERL | |
NSGA2 | |
SPEA2 |
Contributing
Issues and contributions are welcome. Please refer to the contribution guide in the documentation for more details.
Related Projects
- EvoJAX: Hardware-Accelerated Neuroevolution. EvoJAX is a scalable, general purpose, hardware-accelerated neuroevolution toolkit. Paper
- evosax: JAX-Based Evolution Strategies
Citing QDax
If you use QDax in your research and want to cite it in your work, please use:
@article{lim2022accelerated,
title={Accelerated Quality-Diversity for Robotics through Massive Parallelism},
author={Lim, Bryan and Allard, Maxime and Grillotti, Luca and Cully, Antoine},
journal={arXiv preprint arXiv:2202.01258},
year={2022}
}
Contributors
QDax was developed and is maintained by the Adaptive & Intelligent Robotics Lab (AIRL) and InstaDeep.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.