Python implementation of CMA-ES
The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
[BibTeX] cite as:
Nikolaus Hansen, Youhei Akimoto, and Petr Baudis. CMA-ES/pycma on Github. Zenodo, DOI:10.5281/zenodo.2559634, February 2019.
pycmais a Python implementation of CMA-ES and a few related numerical optimization tools.
The Covariance Matrix Adaptation Evolution Strategy (CMA-ES) is a stochastic derivative-free numerical optimization algorithm for difficult (non-convex, ill-conditioned, multi-modal, rugged, noisy) optimization problems in continuous search spaces.
python -m pip install cma
in a system shell to install the latest release from the Python Package Index (PyPI) (which may be behind the lastest release tag on Github). The release link also provides more installation hints and a quick start guide.
conda install --channel cma-es cma
installs from the conda cloud channel
The quick way (requires git to be installed):
pip install git+https://github.com/CMA-ES/[email protected]
The long version: download and unzip the code (see green button above) or
git clone https://github.com/CMA-ES/pycma.gitand
either, copy (or move) the
cmasource code folder into a folder visible to Python, namely a folder which is in the Python path (e.g. the current folder). Then,
import cmaworks without any further installation.
or, install the
cmapackage by typing within the folder, where the
cmasource code folder is visible,
pip install -e cma
cmafolder away from its location would invalidate this installation.
It may be necessary to replace
python -m pipand/or prefixing either of these with
OOOptimizer.optimize(..., n_jobs=...)(fix for
3.0.1/2) and improved
2.7.1allows for a list of termination callbacks and a light copy of
x0to be a callable.
2.4.2added the function
cma.fmin2which, similar to
(x_best:numpy.ndarray, es:cma.CMAEvolutionStrategy)instead of a 10-tuple like
cma.fmin. The result 10-tuple is accessible in
2.2.0added VkD CMA-ES to the master branch.
2.*is a multi-file split-up of the original module.
1.x.*is a one file implementation and not available in the history of this repository. The latest
1.1.7can be found here.