A python implementation of differentiable quality diversity.

Related tags

Miscellaneous dqd
Overview

Differentiable Quality Diversity

This repository is the official implementation of Differentiable Quality Diversity.

The project contains a modified version of pyribs a quality diversity optimization library. All MEGA variants are implemented in pyribs. The GradientEmitter implements both the OG-MAP-Elites and the OMG-MEGA algorithms. The GradientImprovementEmitter implements the CMA-MEGA algorithm.

See ribs/emitters/_gradient_emitter.py and ribs/emitters/_gradient_improvement_emitter.py.

Requirements

The project builds in Anaconda.

Here are the instructions to create the conda environment:

conda env create -f experiments/environment.yml

Next install the local copy of pyribs after activating conda:

conda activate dqdexps
pip3 install -e .[all]

Pretrained Models

You can download the StyleGAN pretrained models from the StyleGAN repo. Place the .pt file in the folder experiments/lsi_clip.

CLIP automatically installs with the conda environment.

Running Experiments

For each experiment you pick an identifier for the algorithm you want to run.

Quality Diversity Algorithm Identifier
MAP-Elites map_elites
MAP-Elites (line) map_elites_line
CMA-ME cma_me_imp
OG-MAP-Elites og_map_elites
OMG-MEGA omg_mega
CMA-MEGA cma_mega
CMA-MEGA (Adam) cma_mega_adam

Linear Projection (sphere)

To run an experiment with MAP-Elites:

conda activate dqdexps
cd experiments/lin_proj

python3 lin_proj.py map_elites --objective sphere

To run a different algorithm replace map_elites with another identifier from the above table.

For additional options see:

python3 lin_proj.py --help

Linear Projection (Rastrigin)

To run an experiment with MAP-Elites:

conda activate dqdexps
cd experiments/lin_proj

python3 lin_proj.py map_elites --objective Rastrigin

To run a different algorithm replace map_elites with another identifier from the above table.

For additional options see:

python3 lin_proj.py --help

Arm Repertoire

To run an experiment with MAP-Elites:

conda activate dqdexps
cd experiments/arm

python3 arm.py map_elites

To run a different algorithm replace map_elites with another identifier from the above table.

For additional options see:

python3 arm.py --help

Latent Space Illumination (LSI)

To run an experiment with MAP-Elites:

conda activate dqdexps
cd experiments/lsi_clip

python3 lsi.py map_elites 

To run a different algorithm replace map_elites with another identifier from the above table.

For additional options see:

python3 lsi.py --help

Results

The following tables contain the reported results from the DQD paper.

Linear Projection (sphere)

Quality Diversity Algorithms QD-score Coverage
MAP-Elites 1.04 1.17%
MAP-Elites (line) 12.21 14.32%
CMA-ME 1.08 1.21%
OG-MAP-Elites 1.52 1.67%
OMG-MEGA 71.58 92.09%
CMA-MEGA 75.29 100.00%
CMA-MEGA (Adam) 75.3 100.00%

Linear Projection (Rastrigin)

Quality Diversity Algorithms QD-score Coverage
MAP-Elites 1.18 1.72%
MAP-Elites (line) 8.12 11.79%
CMA-ME 1.21 1.76%
OG-MAP-Elites 0.83 1.26%
OMG-MEGA 55.90 77.00%
CMA-MEGA 62.54 100.00%
CMA-MEGA (Adam) 62.58 100.00%

Arm Repertoire

Quality Diversity Algorithms QD-score Coverage
MAP-Elites 1.97 8.06%
MAP-Elites (line) 33.51 35.79%
CMA-ME 55.98 56.95%
OG-MAP-Elites 57.17 58.08%
OMG-MEGA 44.12 44.13%
CMA-MEGA 74.18 74.18%
CMA-MEGA (Adam) 73.82 73.82%

Latent Space Illumination (LSI)

Quality Diversity Algorithms QD-score Coverage
MAP-Elites 13.88 23.15%
MAP-Elites (line) 16.54 25.73%
CMA-ME 18.96 26.18%
CMA-MEGA 5.36 8.61%
CMA-MEGA (Adam) 21.82 30.73%

See the paper and supplementary materials for full data and standard error bars.

License

pyribs and this project are both released under the MIT License.

pyribs MIT License

You might also like...
A fast python implementation of DTU MVS 2014 evaluation

DTUeval-python A python implementation of DTU MVS 2014 evaluation. It only takes 1min for each mesh evaluation. And the gap between the two implementa

Double Pendulum implementation in Python, now with added pendulums and trails :D
Double Pendulum implementation in Python, now with added pendulums and trails :D

Double Pendulum Using Curses in Python. A nice relaxing double pendulum simulation using ASCII, able to simulate multiple pendulums at once, and provi

Demo of a WAM Prolog implementation in Python

Prol: WAM demo This is a simplified Warren Abstract Machine (WAM) implementation for Prolog, that showcases the main instructions, compiling, register

Python implementation of Newton's Fractal

Newton's Fractal Animates Newton's fractal between two polynomials of the same order. Inspired by this video by 3Blue1Brown. Example fractals can be f

Python implementation for Active Directory certificate abuse

Certipy is a Python tool to enumerate and abuse misconfigurations in Active Directory Certificate Services (AD CS). Based on the C# variant Ce

Yet another Python Implementation of the Elo rating system.

Python Implementation - Elo Rating System Yet another Python Implementation of the Elo rating system (how innovative am I right?). Only supports 1vs1

A Python software implementation of the Intel 4004 processor
A Python software implementation of the Intel 4004 processor

Pyntel4004 A Python software implementation of the Intel 4004 processor. General Information Two pass assembler using the original mnemonics, directiv

Python implementation of an automatic parallel parking system in a virtual environment, including path planning, path tracking, and parallel parking
Python implementation of an automatic parallel parking system in a virtual environment, including path planning, path tracking, and parallel parking

Automatic Parallel Parking: Path Planning, Path Tracking & Control This repository contains a python implementation of an automatic parallel parking s

Unofficial Python implementation of the DNMF overlapping community detection algorithm

DNMF Unofficial Python implementation of the Discrete Non-negative Matrix Factorization (DNMF) overlapping community detection algorithm Paper Ye, Fan

Owner
ICAROS
Interactive and Collaborative Autonomous Robotic Systems
ICAROS
Improving the Transferability of Adversarial Examples with Resized-Diverse-Inputs, Diversity-Ensemble and Region Fitting

Improving the Transferability of Adversarial Examples with Resized-Diverse-Inputs, Diversity-Ensemble and Region Fitting

Junhua Zou 7 Oct 20, 2022
These are the scripts used for the project of ‘Assembly of a pan-genome for global cattle reveals missing sequence and novel structural variation, providing new insights into their diversity and evolution history’

script-SV-genotyping These are the scripts used for the project of ‘Assembly of a pan-genome for global cattle reveals missing sequence and novel stru

null 2 Aug 26, 2022
Python tools for experimenting with differentiable intonation cost measures

Differentiable Intonation Tools The Differentiable Intonation Tools (dit) are a collection of Python functions to analyze the intonation in multitrack

Simon Schwär 2 Mar 27, 2022
PyScaffold is a project generator for bootstrapping high quality Python packages

PyScaffold is a project generator for bootstrapping high quality Python packages, ready to be shared on PyPI and installable via pip. It is easy to use and encourages the adoption of the best tools and practices of the Python ecosystem, helping you and your team to stay sane, happy and productive. The best part? It is stable and has been used by thousands of developers for over half a decade!

PyScaffold 1.7k Jan 3, 2023
:fishing_pole_and_fish: List of `pre-commit` hooks to ensure the quality of your `dbt` projects.

pre-commit-dbt List of pre-commit hooks to ensure the quality of your dbt projects. BETA NOTICE: This tool is still BETA and may have some bugs, so pl

Offbi 262 Nov 25, 2022
0CD - BinaryNinja plugin to introduce some quality of life utilities for obsessive compulsive CTF enthusiasts

0CD Author: b0bb Quality of life utilities for obsessive compulsive CTF enthusia

null 12 Sep 14, 2022
Implementation of the Angular Spectrum method in Python to simulate Diffraction Patterns

Diffraction Simulations - Angular Spectrum Method Implementation of the Angular Spectrum method in Python to simulate Diffraction Patterns with arbitr

Rafael de la Fuente 276 Dec 30, 2022
Python implementation of the ASFLIP advection method

This is a python implementation of the ASFLIP advection method . We would like to hear from you if you appreciate this work.

Raymond Yun Fei 133 Nov 13, 2022
A Gura parser implementation for Python

Gura parser This repository contains the implementation of a Gura format parser in Python. Installation pip install gura-parser Usage import gura gur

JWare Solutions 19 Jan 25, 2022
Reference python implementation of Chia pool operations for pool operators

This repository provides a sample server written in python, which is meant to server as a basis for a Chia Pool. While this is a fully functional implementation, it requires some work in scalability and security to run in production.

Chia Network 451 Dec 13, 2022