All Projects → icaros-usc → Pyribs

icaros-usc / Pyribs

Licence: mit
A bare-bones Python library for quality diversity optimization.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pyribs

Jenetics
Jenetics - Genetic Algorithm, Genetic Programming, Evolutionary Algorithm, and Multi-objective Optimization
Stars: ✭ 616 (+833.33%)
Mutual labels:  artificial-intelligence, evolutionary-algorithms, optimization
Pygmo2
A Python platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
Stars: ✭ 134 (+103.03%)
Mutual labels:  artificial-intelligence, evolutionary-algorithms, optimization
Pagmo2
A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
Stars: ✭ 540 (+718.18%)
Mutual labels:  artificial-intelligence, evolutionary-algorithms, optimization
Geneticalgorithmpython
Source code of PyGAD, a Python 3 library for building the genetic algorithm and training machine learning algorithms (Keras & PyTorch).
Stars: ✭ 435 (+559.09%)
Mutual labels:  evolutionary-algorithms, optimization
Opytimizer
🐦 Opytimizer is a Python library consisting of meta-heuristic optimization techniques.
Stars: ✭ 387 (+486.36%)
Mutual labels:  artificial-intelligence, optimization
Optim
OptimLib: a lightweight C++ library of numerical optimization methods for nonlinear functions
Stars: ✭ 411 (+522.73%)
Mutual labels:  evolutionary-algorithms, optimization
Evostra
A fast Evolution Strategy implementation in Python
Stars: ✭ 227 (+243.94%)
Mutual labels:  artificial-intelligence, evolutionary-algorithms
Gym Starcraft
StarCraft environment for OpenAI Gym, based on Facebook's TorchCraft. (In progress)
Stars: ✭ 514 (+678.79%)
Mutual labels:  artificial-intelligence, openai-gym
Solid
🎯 A comprehensive gradient-free optimization framework written in Python
Stars: ✭ 546 (+727.27%)
Mutual labels:  artificial-intelligence, optimization
Eaopt
🍀 Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution)
Stars: ✭ 718 (+987.88%)
Mutual labels:  evolutionary-algorithms, optimization
Rex Gym
OpenAI Gym environments for an open-source quadruped robot (SpotMicro)
Stars: ✭ 684 (+936.36%)
Mutual labels:  artificial-intelligence, openai-gym
Basic reinforcement learning
An introductory series to Reinforcement Learning (RL) with comprehensive step-by-step tutorials.
Stars: ✭ 826 (+1151.52%)
Mutual labels:  artificial-intelligence, openai-gym
Home Platform
HoME: a Household Multimodal Environment is a platform for artificial agents to learn from vision, audio, semantics, physics, and interaction with objects and other agents, all within a realistic context.
Stars: ✭ 370 (+460.61%)
Mutual labels:  artificial-intelligence, openai-gym
goga
Go evolutionary algorithm is a computer library for developing evolutionary and genetic algorithms to solve optimisation problems with (or not) many constraints and many objectives. Also, a goal is to handle mixed-type representations (reals and integers).
Stars: ✭ 39 (-40.91%)
Mutual labels:  optimization, evolutionary-algorithms
Spot mini mini
Dynamics and Domain Randomized Gait Modulation with Bezier Curves for Sim-to-Real Legged Locomotion.
Stars: ✭ 426 (+545.45%)
Mutual labels:  openai-gym, optimization
zoofs
zoofs is a python library for performing feature selection using a variety of nature-inspired wrapper algorithms. The algorithms range from swarm-intelligence to physics-based to Evolutionary. It's easy to use , flexible and powerful tool to reduce your feature size.
Stars: ✭ 142 (+115.15%)
Mutual labels:  optimization, evolutionary-algorithms
Online Relationship Learning
Unsupervised ML algorithm for predictive modeling and time-series analysis
Stars: ✭ 34 (-48.48%)
Mutual labels:  artificial-intelligence, optimization
Scikit Opt
Genetic Algorithm, Particle Swarm Optimization, Simulated Annealing, Ant Colony Optimization Algorithm,Immune Algorithm, Artificial Fish Swarm Algorithm, Differential Evolution and TSP(Traveling salesman)
Stars: ✭ 2,791 (+4128.79%)
Mutual labels:  artificial-intelligence, optimization
Hyperactive
A hyperparameter optimization and data collection toolbox for convenient and fast prototyping of machine-learning models.
Stars: ✭ 182 (+175.76%)
Mutual labels:  artificial-intelligence, optimization
Hyperparameter hunter
Easy hyperparameter optimization and automatic result saving across machine learning algorithms and libraries
Stars: ✭ 648 (+881.82%)
Mutual labels:  artificial-intelligence, optimization

pyribs

Website Source PyPI Conda CI/CD Docs Docs Status Twitter
pyribs.org GitHub PyPI Conda Recipe Tests docs.pyribs.org Documentation Status Twitter

A bare-bones Python library for quality diversity optimization. pyribs is the official implementation of the Covariance Matrix Adaptation MAP-Elites (CMA-ME) algorithm and implements the Rapid Illumination of Behavior Space (RIBS) redesign of MAP-Elites detailed in the paper Covariance Matrix Adapation for the Rapid Illumination of Behavior Space.

Overview

Types of Optimization

Quality diversity (QD) optimization is a subfield of optimization where solutions generated cover every point in a behavior space while simultaneously maximizing (or minimizing) a single objective. QD algorithms within the MAP-Elites family of QD algorithms produce heatmaps (archives) as output where each cell contains the best discovered representative of a region in behavior space.

While many QD libraries exist, this particular library aims to be the QD analog to the pycma library (a single objective optimization library). In contrast to other QD libraries, this library is "bare-bones," meaning pyribs (like pycma) focuses solely on optimizing fixed-dimensional continuous domains. Focusing solely on this one commonly-occurring problem allows us to optimize the library for performance as well as simplicity of use. For applications of QD on discrete domains, we recommend using qdpy or sferes.

A user of pyribs selects three components that meet the needs of their application:

  • An Archive saves the best representatives generated within behavior space.
  • Emitters control how new candidate solutions are generated and affect if the algorithm prioritizes quality or diversity.
  • An Optimizer joins the Archive and Emitters together and acts as a scheduling algorithm for emitters. The Optimizer provides an interface for requesting new candidate solutions and telling the algorithm how candidates performed.

Citation

If you use pyribs in your research, please cite it as follows. Note that you will need to include the hyperref package in order to use the \url command.

@misc{pyribs,
  title = {pyribs: A bare-bones Python library for quality diversity
           optimization},
  author = {Bryon Tjanaka and Matthew C. Fontaine and Yulun Zhang and
            Sam Sommerer and Nathan Dennler and Stefanos Nikolaidis},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/icaros-usc/pyribs}},
}

If you use the CMA-ME algorithm, please also cite Fontaine 2020.

@inproceedings{10.1145/3377930.3390232,
  author = {Fontaine, Matthew C. and Togelius, Julian and Nikolaidis, Stefanos and Hoover, Amy K.},
  title = {Covariance Matrix Adaptation for the Rapid Illumination of Behavior Space},
  year = {2020},
  isbn = {9781450371285},
  publisher = {Association for Computing Machinery},
  address = {New York, NY, USA},
  url = {https://doi.org/10.1145/3377930.3390232},
  doi = {10.1145/3377930.3390232},
  booktitle = {Proceedings of the 2020 Genetic and Evolutionary Computation Conference},
  pages = {94–102},
  numpages = {9},
  location = {Canc\'{u}n, Mexico},
  series = {GECCO '20}
}

Usage

Here we show an example application of CMA-ME in pyribs. To initialize the algorithm, we first create:

  • A 2D GridArchive where each dimension contains 20 bins across the range [-1, 1].
  • An ImprovementEmitter, which starts from the search point 0 in 10 dimensional space and a Gaussian sampling distribution with standard deviation 0.1.
  • An Optimizer that combines the archive and emitter together.

After initializing the components, we optimize (pyribs maximizes) the negative 10-D Sphere function for 1000 iterations. Users of pycma will be familiar with the ask-tell interface (which pyribs adopted). First, the user must ask the optimizer for new candidate solutions. After evaluating the solution, they tell the optimizer the objective value and behavior characteristics (BCs) of each candidate solution. The algorithm then populates the archive and makes decisions on where to sample solutions next. Our toy example uses the first two parameters of the search space as BCs.

import numpy as np

from ribs.archives import GridArchive
from ribs.emitters import ImprovementEmitter
from ribs.optimizers import Optimizer

archive = GridArchive([20, 20], [(-1, 1), (-1, 1)])
emitters = [ImprovementEmitter(archive, [0.0] * 10, 0.1)]
optimizer = Optimizer(archive, emitters)

for itr in range(1000):
    solutions = optimizer.ask()

    objectives = -np.sum(np.square(solutions), axis=1)
    bcs = solutions[:, :2]

    optimizer.tell(objectives, bcs)

To visualize this archive with matplotlib, we then use the grid_archive_heatmap function from ribs.visualize.

import matplotlib.pyplot as plt
from ribs.visualize import grid_archive_heatmap

grid_archive_heatmap(archive)
plt.show()

Sphere heatmap

For more information, refer to the documentation.

Installation

pyribs supports Python 3.6-3.8 (for now, 3.9 will only work if you are able to build llvmlite on your system). Earlier Python versions may work but are not officially supported.

To install from PyPI, run

pip install ribs

This command only installs dependencies for the core of pyribs. To install support tools like ribs.visualize, run

pip install ribs[all]

Equivalently, you can install the base version (equivalent to ribs) from Conda with

conda install -c conda-forge pyribs-base

The full version (equivalent to ribs[all]) can be installed with

conda install -c conda-forge pyribs

To test your installation, import it and print the version with:

python -c "import ribs; print(ribs.__version__)"

You should see a version number like 0.2.0 in the output.

From Source

To install a version from source, clone the repo

git clone https://github.com/icaros-usc/pyribs

Then cd into it

cd pyribs

And run

pip install -e .[all]

Documentation

See here for the documentation: https://docs.pyribs.org

To serve the documentation locally, clone the repo and install the development requirements with

pip install -e .[dev]

Then run

make servedocs

This will open a window in your browser with the documentation automatically loaded. Furthermore, every time you make changes to the documentation, the preview will also reload.

Contributors

pyribs is developed and maintained by the ICAROS Lab at USC.

We thank Amy K. Hoover and Julian Togelius for their contributions deriving the CMA-ME algorithm.

License

pyribs is released under the MIT License.

Credits

The pyribs package was initially created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].