Skip to main content

Quality-Diversity algorithms in Python

Project description

Package qdpy implements recent Quality-Diversity algorithms: Map-Elites, CVT-Map-Elites, NSLC, SAIL, etc. QD algorithms can be accessed directly, but qdpy also includes building blocks that can be easily assembled together to build your own QD algorithms. It can be used with parallelism mechanisms and in distributed environments.

This package requires Python 3.6+.

qdpy includes the following features:
  • Generic support for diverse Containers: Grids, Novelty-Archives, Populations, etc

  • Optimisation algorithms for QD: random search methods, quasi-random methods, evolutionary algorithms

  • Support for multi-objective optimisation methods

  • Possible to use optimisation methods not designed for QD, such as [CMA-ES](https://arxiv.org/pdf/1604.00772.pdf)

  • Parallelisation of evaluations, using parallelism libraries, such as multiprocessing, concurrent.futures or [SCOOP](https://github.com/soravux/scoop)

  • Easy integration with the popular [DEAP](https://github.com/DEAP/deap) evolutionary computation framework

Install

qdpy requires Python 3.6+. It can be installed with:

pip3 install qdpy

qdpy includes optional features that need extra packages to be installed:
  • cma for CMA-ES support

  • deap to integrate with the DEAP library

  • tables to output results files in the HDF5 format

  • tqdm to display a progress bar showing optimisation progress

  • colorama to add colours to pretty-printed outputs

You can install qdpy and all of these optional dependencies with:

pip3 install qdpy[all]

The latest version can be installed from the GitLab repository:

pip3 install git+https://gitlab.com/leo.cazenille/qdpy.git@master

Example

From a python shell:

from qdpy import algorithms, containers, benchmarks, plots

# Create container and algorithm. Here we use MAP-Elites, by illuminating a Grid container by evolution.
grid = containers.Grid(shape=(64,64), max_items_per_bin=1, fitness_domain=((0., 1.),), features_domain=((0., 1.), (0., 1.)))
algo = algorithms.RandomSearchMutPolyBounded(grid, budget=60000, batch_size=500,
        dimension=3, optimisation_task="maximisation")

# Create a logger to pretty-print everything and generate output data files
logger = algorithms.AlgorithmLogger(algo)

# Define evaluation function
eval_fn = algorithms.partial(benchmarks.illumination_rastrigin_normalised,
        nb_features = len(grid.shape))

# Run illumination process !
best = algo.optimise(eval_fn)

# Print results info
print(algo.summary())

# Plot the results
plots.default_plots_grid(logger)

print("All results are available in the '%s' pickle file." % logger.final_filename)

Usage, Documentation

Please to go the GitLab repository main page (https://gitlab.com/leo.cazenille/qdpy) and the documentation main page (https://leo.cazenille.gitlab.io/qdpy/).

Author:

Leo Cazenille, 2018-*

License:

LGPLv3, see LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qdpy-0.0.9.3.tar.gz (763.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qdpy-0.0.9.3-py3-none-any.whl (806.8 kB view details)

Uploaded Python 3

File details

Details for the file qdpy-0.0.9.3.tar.gz.

File metadata

  • Download URL: qdpy-0.0.9.3.tar.gz
  • Upload date:
  • Size: 763.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.8.0 tqdm/4.31.0 CPython/3.7.3

File hashes

Hashes for qdpy-0.0.9.3.tar.gz
Algorithm Hash digest
SHA256 39f479b0c8cad58fa125f1df2bff8ee619427898010657deed09a3e82d546cd0
MD5 dbe457a9184cb48f0f86e3d21541d7ca
BLAKE2b-256 7681dbf28dc2850e8fc3bc604df554258b321030a42c0baf22b3ccc26a55ac2f

See more details on using hashes here.

File details

Details for the file qdpy-0.0.9.3-py3-none-any.whl.

File metadata

  • Download URL: qdpy-0.0.9.3-py3-none-any.whl
  • Upload date:
  • Size: 806.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.8.0 tqdm/4.31.0 CPython/3.7.3

File hashes

Hashes for qdpy-0.0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6b556d7e3c87da783c9e92114db5cdd05701060d0c83a89b02546d5f246310aa
MD5 7e9489790645fa83a09dc31bc3a4a951
BLAKE2b-256 f413e3b7173b109ef2c40f726480e3a3ac86f3f8df7b29fa88cbe76476f7ca69

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page