https://github.com/adaptive-intelligent-robotics/qdax

Accelerated Quality-Diversity

https://github.com/adaptive-intelligent-robotics/qdax

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, ieee.org, acm.org
  • Committers with academic emails
    6 of 18 committers (33.3%) from academic institutions
  • Institutional organization owner
    Organization adaptive-intelligent-robotics has institutional domain (www.imperial.ac.uk)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (20.0%) to scientific vocabulary

Keywords

framework jax neuroevolution quality-diversity reinforcement-learning research
Last synced: 6 months ago · JSON representation

Repository

Accelerated Quality-Diversity

Basic Info
Statistics
  • Stars: 313
  • Watchers: 6
  • Forks: 55
  • Open Issues: 30
  • Releases: 9
Topics
framework jax neuroevolution quality-diversity reinforcement-learning research
Created about 4 years ago · Last pushed 8 months ago
Metadata Files
Readme License

README.md

qdax_logo

QDax: Accelerated Quality-Diversity

Documentation Status pytest License: MIT codecov

QDax is a tool to accelerate Quality-Diversity (QD) and neuroevolution 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! Open All Collab

Installation

QDax is available on PyPI and can be installed with: bash pip install qdax

To install QDax with CUDA 12 support, use: bash pip install qdax[cuda12]

Alternatively, the latest commit of QDax can be installed directly from source with: bash pip install git+https://github.com/adaptive-intelligent-robotics/QDax.git@main Installing QDax via pip installs a CPU-only version of JAX by default. To use QDax with NVidia GPUs, you must first install CUDA, CuDNN, and JAX with GPU support.

However, we also provide and recommend using either Docker or conda environments to use the repository which by default provides GPU support. 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: ```python import jax import functools from qdax.core.mapelites import MAPElites from qdax.core.containers.mapelitesrepertoire import computeeuclideancentroids from qdax.tasks.arm import armscoringfunction from qdax.core.emitters.mutationoperators import isolinevariation from qdax.core.emitters.standardemitters import MixingEmitter from qdax.utils.metrics import defaultqd_metrics

seed = 42 numparamdimensions = 100 # num DoF arm initbatchsize = 100 batchsize = 1024 numiterations = 50 gridshape = (100, 100) minparam = 0.0 maxparam = 1.0 mindescriptor = 0.0 max_descriptor = 1.0

Init a random key

key = jax.random.key(seed)

Init population of controllers

key, subkey = jax.random.split(key) initvariables = jax.random.uniform( subkey, shape=(initbatchsize, numparamdimensions), minval=minparam, maxval=max_param, )

Define emitter

variationfn = functools.partial( isolinevariation, isosigma=0.05, linesigma=0.1, minval=minparam, maxval=maxparam, ) mixingemitter = MixingEmitter( mutationfn=lambda x, y: (x, y), variationfn=variationfn, variationpercentage=1.0, batchsize=batch_size, )

Define a metrics function

metricsfn = functools.partial( defaultqdmetrics, qdoffset=0.0, )

Instantiate MAP-Elites

mapelites = MAPElites( scoringfunction=armscoringfunction, emitter=mixingemitter, metricsfunction=metrics_fn, )

Compute the centroids

centroids = computeeuclideancentroids( gridshape=gridshape, minval=mindescriptor, maxval=maxdescriptor, )

Initializes repertoire and emitter state

key, subkey = jax.random.split(key) repertoire, emitterstate, metrics = mapelites.init(init_variables, centroids, subkey)

Jit the update function for faster iterations

updatefn = jax.jit(mapelites.update)

Run MAP-Elites loop

for i in range(numiterations): key, subkey = jax.random.split(key) (repertoire, emitterstate, metrics,) = updatefn( repertoire, emitterstate, subkey, )

Get contents of repertoire

repertoire.genotypes, repertoire.fitnesses, repertoire.descriptors ```

QDax core algorithms

QDax currently supports the following algorithms:

| Algorithm | Example | |-------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | MAP-Elites | Open All Collab | | AURORA | Open All Collab | | CVT MAP-Elites | Open All Collab | | Policy Gradient Assisted MAP-Elites (PGA-ME) | Open All Collab | | DCRL-ME | Open All Collab | | QDPG | Open All Collab | | CMA-ME | Open All Collab | | OMG-MEGA | Open All Collab | | CMA-MEGA | Open All Collab | | Multi-Objective MAP-Elites (MOME) | Open All Collab | | MAP-Elites Evolution Strategies (MEES) | Open All Collab | | MAP-Elites PBT (ME-PBT) | Open All Collab | | MAP-Elites Low-Spread (ME-LS) | Open All Collab |

QDax baseline algorithms

The QDax library also provides implementations for some useful baseline algorithms:

| Algorithm | Example | | --- | --- | | DIAYN | Open All Collab | | DADS | Open All Collab | | SMERL | Open All Collab | | NSGA2 | Open All Collab | | SPEA2 | Open All Collab | | Population Based Training (PBT) | Open All Collab |

QDax Tasks

The QDax library also provides numerous implementations for several standard Quality-Diversity tasks.

All those implementations, and their descriptions are provided in the tasks directory.

Contributing

Issues and contributions are welcome. Please refer to the contribution guide in the documentation for more details.

Related Projects

Citing QDax

If you use QDax in your research and want to cite it in your work, please use: @article{chalumeau2024qdax, title={Qdax: A library for quality-diversity and population-based algorithms with hardware acceleration}, author={Chalumeau, Felix and Lim, Bryan and Boige, Raphael and Allard, Maxime and Grillotti, Luca and Flageat, Manon and Mac{\'e}, Valentin and Richard, Guillaume and Flajolet, Arthur and Pierrot, Thomas and others}, journal={Journal of Machine Learning Research}, volume={25}, number={108}, pages={1--16}, year={2024} }

Contributors

QDax was developed and is maintained by the Adaptive & Intelligent Robotics Lab (AIRL) and InstaDeep.

AIRL_Logo InstaDeep_Logo

Owner

  • Name: Adaptive and Intelligent Robotics Lab
  • Login: adaptive-intelligent-robotics
  • Kind: organization
  • Location: Imperial College, London

GitHub Events

Total
  • Create event: 10
  • Release event: 2
  • Issues event: 28
  • Watch event: 53
  • Delete event: 13
  • Issue comment event: 18
  • Push event: 50
  • Pull request review comment event: 25
  • Pull request review event: 32
  • Pull request event: 35
  • Fork event: 10
Last Year
  • Create event: 10
  • Release event: 2
  • Issues event: 28
  • Watch event: 53
  • Delete event: 13
  • Issue comment event: 18
  • Push event: 50
  • Pull request review comment event: 25
  • Pull request review event: 32
  • Pull request event: 35
  • Fork event: 10

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 129
  • Total Committers: 18
  • Avg Commits per committer: 7.167
  • Development Distribution Score (DDS): 0.589
Past Year
  • Commits: 26
  • Committers: 9
  • Avg Commits per committer: 2.889
  • Development Distribution Score (DDS): 0.654
Top Committers
Name Email Commits
Felix Chalumeau f****u@i****m 53
Luca Grillotti l****i@g****m 14
Luca Grillotti l****6@i****k 13
Bryan Lim 4****n 9
Luca Grillotti l****5@i****k 9
Manon Flageat 6****s 8
bryan b****6@i****k 5
maxiallard m****d@y****e 3
Maxime Allard m****0@i****k 3
Manon Flageat m****8@i****k 2
Maxime Allard m****0@i****k 2
Bryon Tjanaka 3****a 2
Antoine Cully a****y@h****m 1
Maxence Faldor m****r@g****m 1
Thomas Pierrot 3****m 1
Raphaël Boige 4****b 1
David Braun 2****n 1
limbryan l****9@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 78
  • Total pull requests: 93
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 21
  • Total pull request authors: 18
  • Average comments per issue: 0.58
  • Average comments per pull request: 0.88
  • Merged pull requests: 69
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 15
  • Pull requests: 18
  • Average time to close issues: 3 months
  • Average time to close pull requests: 26 days
  • Issue authors: 6
  • Pull request authors: 6
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.33
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • felixchalumeau (33)
  • Lookatator (19)
  • MartinMao2023 (5)
  • manon-but-yes (4)
  • blacksph3re (3)
  • DBraun (2)
  • Aneoshun (2)
  • hannah-jan (2)
  • limbryan (2)
  • mplemay (1)
  • oilyraisin (1)
  • kayuksel (1)
  • miltonllera (1)
  • tcfuji (1)
  • btjanaka (1)
Pull Request Authors
  • Lookatator (33)
  • felixchalumeau (28)
  • manon-but-yes (10)
  • LisaCoiffard (6)
  • limbryan (5)
  • maxencefaldor (5)
  • hannah-jan (5)
  • TemplierPaul (5)
  • BioGeek (2)
  • btjanaka (2)
  • MartinMao2023 (2)
  • miltonllera (2)
  • mplemay (1)
  • DBraun (1)
  • eltociear (1)
Top Labels
Issue Labels
enhancement (19) bug (12) refactoring (5) good first issue (3) documentation (2) help wanted (1) metrics (1)
Pull Request Labels
enhancement (12) refactoring (4) bug (3) release (2) code update (2) documentation (1) metrics (1) CI (1)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 2,461 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 32
  • Total maintainers: 3
proxy.golang.org: github.com/adaptive-intelligent-robotics/QDax
  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 6.9%
Last synced: 6 months ago
proxy.golang.org: github.com/adaptive-intelligent-robotics/qdax
  • Versions: 11
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 6.9%
Last synced: 6 months ago
pypi.org: qdax

A Python Library for Quality-Diversity and NeuroEvolution

  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 2,461 Last month
Rankings
Stargazers count: 4.5%
Dependent packages count: 7.3%
Forks count: 8.1%
Downloads: 9.1%
Average: 10.2%
Dependent repos count: 22.1%
Maintainers (3)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • absl-py ==1.0.0
  • brax ==0.0.12
  • chex ==0.1.3
  • dm-haiku ==0.0.5
  • flax ==0.4.1
  • gym ==0.23.1
  • ipython *
  • jax ==0.3.10
  • jupyter *
  • numpy ==1.22.3
  • protobuf ==3.19.4
  • scikit-learn ==1.0.2
  • scipy ==1.8.0
  • seaborn ==0.11.2
  • sklearn ==0.0
  • tensorflow-probability ==0.15.0
  • typing-extensions ==3.10
docs/requirements.txt pypi
  • livereload ==2.6.3
  • mkdocs ==1.2.3
  • mkdocs-autorefs ==0.3.1
  • mkdocs-git-revision-date-plugin ==0.3.1
  • mkdocs-material ==8.2.3
  • mkdocstrings ==0.18.1
  • mknotebooks ==0.7.1
requirements-dev.txt pypi
  • coverage *
  • pre-commit ==2.12.1
  • pytest ==6.2.5
  • pytest-assume ==2.4.3
requirements-tool.txt pypi
  • pre-commit ==2.12.1
setup.py pypi
  • absl-py >=1.0.0
  • brax >=0.0.12
  • flax >=0.4.1
  • gym >=0.23.1
  • jax >=0.3.10
  • jaxlib >=0.3.10
  • numpy >=1.22.3
  • scikit-learn >=1.0.2
  • scipy >=1.8.0
  • sklearn *
.github/workflows/ci.yaml actions
  • FranzDiebold/github-env-vars-action v2 composite
  • actions/checkout v2 composite
  • codecov/codecov-action v2 composite
  • docker/build-push-action v3 composite
  • docker/login-action v2 composite
  • docker/metadata-action v4 composite
  • docker/setup-buildx-action v2 composite
environment.yaml pypi