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
The latest stable release of QDax can be installed directly from source with:
pip install git+https://github.com/adaptive-intelligent-robotics/QDax.git@main
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.
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 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) |
The QDax library also provides implementations for some useful baseline algorithms:
Algorithm | Example |
---|---|
DIAYN | |
DADS | |
SMERL | |
NSGA2 | |
SPEA2 |
Issues and contributions are welcome. Please refer to the contribution guide in the documentation for more details.
- EvoJAX: Hardware-Accelerated Neuroevolution. EvoJAX is a scalable, general purpose, hardware-accelerated neuroevolution toolkit. Paper
- evosax: JAX-Based Evolution Strategies
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}
}
QDax was developed and is maintained by the Adaptive & Intelligent Robotics Lab (AIRL) and InstaDeep.