{"id":13751667,"url":"https://github.com/CMA-ES/pycma","last_synced_at":"2025-05-09T18:32:00.918Z","repository":{"id":11249058,"uuid":"68926339","full_name":"CMA-ES/pycma","owner":"CMA-ES","description":"Python implementation of CMA-ES","archived":false,"fork":false,"pushed_at":"2025-03-21T13:12:29.000Z","size":3367,"stargazers_count":1167,"open_issues_count":72,"forks_count":181,"subscribers_count":15,"default_branch":"development","last_synced_at":"2025-04-23T21:45:11.969Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CMA-ES.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-22T13:55:01.000Z","updated_at":"2025-04-23T19:10:16.000Z","dependencies_parsed_at":"2023-01-13T18:00:29.751Z","dependency_job_id":"d6e043ac-1c21-40d8-aab7-fa989aa30263","html_url":"https://github.com/CMA-ES/pycma","commit_stats":{"total_commits":785,"total_committers":18,"mean_commits":"43.611111111111114","dds":"0.19490445859872607","last_synced_commit":"334abfca441a2cc5d6db548dc9328fc15edde3c4"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMA-ES%2Fpycma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMA-ES%2Fpycma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMA-ES%2Fpycma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMA-ES%2Fpycma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CMA-ES","download_url":"https://codeload.github.com/CMA-ES/pycma/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253303038,"owners_count":21886876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T09:00:51.457Z","updated_at":"2025-05-09T18:32:00.881Z","avatar_url":"https://github.com/CMA-ES.png","language":"Jupyter Notebook","funding_links":[],"categories":["Evolutionary Algorithms (EA)","参数优化","Jupyter Notebook"],"sub_categories":["RL/DRL Books"],"readme":"# pycma \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \n[![CircleCI](https://circleci.com/gh/CMA-ES/pycma/tree/master.svg?style=shield)](https://circleci.com/gh/CMA-ES/pycma/tree/master)\n[![Build status](https://ci.appveyor.com/api/projects/status/1rge11pwyt55b26k?svg=true)](https://ci.appveyor.com/project/nikohansen/pycma)\n![GitHub Repo stars](https://img.shields.io/github/stars/CMA-ES/pycma?style=flat)\n[![Downloads](https://static.pepy.tech/badge/cma/month)](https://pepy.tech/project/cma)\n[![DOI](https://zenodo.org/badge/68926339.svg)](https://doi.org/10.5281/zenodo.2559634)\n[[BibTeX](https://github.com/CMA-ES/CMA-ES.github.io/blob/master/pycmabibtex.bib)] cite as:\n\u003e Nikolaus Hansen, Youhei Akimoto, and Petr Baudis. CMA-ES/pycma on Github. Zenodo, [DOI:10.5281/zenodo.2559634](https://doi.org/10.5281/zenodo.2559634), February 2019. \n---\n\n\u003c!--- \n\n[![Build status](https://ci.appveyor.com/api/projects/status/1rge11pwyt55b26k/branch/master?svg=true)](https://ci.appveyor.com/project/nikohansen/pycma/branch/master)\n\nZenodo: 34 points to the latest, this is 35: https://zenodo.org/badge/latestdoi/68926339 \n\n---\u003e\n  \n``pycma`` is a Python implementation of [CMA-ES](http://cma-es.github.io/) and a few related numerical optimization tools.\n\nThe [Covariance Matrix Adaptation Evolution Strategy](https://en.wikipedia.org/wiki/CMA-ES) \n([CMA-ES](http://cma-es.github.io/)) is a stochastic derivative-free numerical optimization\nalgorithm for difficult (non-convex, ill-conditioned, multi-modal, rugged, noisy) optimization\nproblems in continuous search spaces.\n\nUseful links:\n\n* [A quick start guide with a few usage examples](https://pypi.python.org/pypi/cma)\n\n* [The above `notebooks` folder has some example code in Jupyter notebooks](https://github.com/CMA-ES/pycma/tree/master/notebooks)\n\n* [The API Documentation](http://cma-es.github.io/apidocs-pycma)\n\n* [Hints for how to use this (kind of) optimization module in practice](http://cma-es.github.io/cmaes_sourcecode_page.html#practical)\n\n* [FAQs and HowTos (under development)](https://github.com/CMA-ES/pycma/issues?q=is:issue+label:FAQ).\n\n## Installation of the [latest release](https://pypi.python.org/pypi/cma)\n\nIn a system shell, type\n\n```sh\n    python -m pip install cma\n```\n\nto install the [latest release](https://pypi.python.org/pypi/cma)\nfrom the [Python Package Index (PyPI)](https://pypi.python.org/pypi). The [release link](https://pypi.python.org/pypi/cma) also provides more installation hints and a quick start guide.\n\n```sh\n    conda install --channel cma-es cma\n```\n\ninstalls from the conda cloud channel `cma-es`. CAVEAT: this distribution is currently not updated!\n\n## Installation from Github\n\nThe quick way (this requires [`git`](https://git-scm.com) to be installed): to install the code from, for example, the `master` branch, copy-paste\n\n```sh\n    pip install git+https://github.com/CMA-ES/pycma.git@master\n```\n\nThe long way:\n\n- get the package\n\n  - either download and unzip the code by clicking the green button above\n  - or, with [`git`](https://git-scm.com) installed, type ``git clone https://github.com/CMA-ES/pycma.git``\n\n- \"install\" the package\n\n  - either copy (or move) the ``cma`` source code folder into a folder which is in the\n    [Python path](https://docs.python.org/3/library/sys.html#sys.path) (e.g. the current folder)\n\n  - or modify the [Python path](https://docs.python.org/3/library/sys.html#sys.path) to point\n    to the folder where the ``cma`` package folder can be found.\n    In both cases, ``import cma`` works without any further installation.\n\n  - or install the ``cma`` package by typing\n\n    ```sh\n        pip install -e cma\n    ```\n    in the folder where the ``cma`` package folder can be found.\n    Moving the ``cma`` folder away from its location invalidates this\n    installation.\n\nIt may be necessary to replace ``pip`` with ``python -m pip`` and/or prefixing\neither of these with ``sudo``.\n\n## Version History\n\n* [Release ``4.0.0``](https://github.com/CMA-ES/pycma/releases/tag/r4.0.0)\n  - majorly improved mixed-integer handling based on a more concise lower bound\n    of variances and on so-called integer centering\n  - moved options and parameters code into a new file\n  - many small-ish fixes and improvements\n* [Release ``3.4.0``](https://github.com/CMA-ES/pycma/releases/tag/r3.4.0)\n  - fix compatibility to `numpy` 2.0 (thanks to [Sait Cakmak](https://github.com/saitcakmak))\n  - improved interface to `noise_handler` argument which accepts `True` as value\n  - improved interface to `ScaleCoordinates` now also with lower and upper value mapping to [0, 1], see [issue #210](https://github.com/CMA-ES/pycma/issues/210)\n  - changed: `'ftarget'` triggers with \u003c= instead of \u003c\n  - assign `surrogate` attribute (for the record) when calling `fmin_lq_surr`\n  - various (minor) bug fixes\n  - various (small) improvements of the plots and their usability\n    - display iterations, evaluations and population size and termination\n      criteria in the plots\n    - subtract any recorded x from the plotted x-values by ``x_opt=index``\n  - plots are now versus iteration number instead of evaluations by default\n  - provide legacy `bbobbenchmarks` without downloading\n  - new: `CMADataLogger.zip` allows sharing plotting data more easily by a zip file\n  - new: `tolxstagnation` termination condition for when the incumbent seems stuck\n  - new: collect restart terminations in `cma.evalution_strategy.all_stoppings`\n  - new: `stall_sigma_change_on_divergence_iterations` option to stall\n    `sigma` change when the median fitness is worsening\n  - new: limit active C update for integer variables\n  - new: provide a COCO single function\n\n* [Release ``3.3.0``](https://github.com/CMA-ES/pycma/releases/tag/r3.3.0)\n  implements\n  - diagonal acceleration via diagonal decoding (option\n    `CMA_diagonal_decoding`, by default still off).\n  - `fmin_lq_surr2` for running the surrogate assisted\n    [lq-CMA-ES](https://cma-es.github.io/lq-cma).\n  - `optimization_tools.ShowInFolder` to facilitate rapid experimentation.\n  - `verb_disp_overwrite` option starts to overwrite the last line of the\n    display output instead of continuing adding lines to avoid screen\n    flooding with longish runs (off by default).\n  - various smallish improvements, bug fixes and additional features and\n    functions.\n\n* [Release ``3.2.2``](https://github.com/CMA-ES/pycma/releases/tag/r3.2.2)\n  fixes some smallish interface and logging bugs in `ConstrainedFitnessAL`\n  and a bug when printing a warning. Polishing mainly in the plotting\n  functions. Added a notebook for how to use constraints.\n\n* [Release ``3.2.1``](https://github.com/CMA-ES/pycma/releases/tag/r3.2.1)\n  fixes plot of principal axes which were shown squared by mistake in version 3.2.0.\n\n* [Release ``3.2.0``](https://github.com/CMA-ES/pycma/releases/tag/r3.2.0)\n  provides a new interface for constrained optimization `ConstrainedFitnessAL`\n  and `fmin_con2` and many other minor fixes and improvements.\n\n* [Release ``3.1.0``](https://github.com/CMA-ES/pycma/releases/tag/r3.1.0)\n  fixes the return value of `fmin_con`, improves its usability and provides\n  a `best_feasible` attribute in `CMAEvolutionStrategy`, in addition to\n  various other more minor code fixes and improvements.\n\n* [Release ``3.0.3``](https://github.com/CMA-ES/pycma/releases/tag/r3.0.3) provides parallelization with ``OOOptimizer.optimize(..., n_jobs=...)`` (fix for ``3.0.1/2``) and improved `pickle` support.\n\n* [Release ``3.0.0``](https://github.com/CMA-ES/pycma/releases/tag/r3.0.0) provides non-linear constraints handling, improved plotting and termination options and better resilience to injecting bad solutions, and further various fixes.\n\n* Version ``2.7.1`` allows for a list of termination callbacks and a light copy of `CMAEvolutionStrategy` instances.\n\n* [Release ``2.7.0``](https://github.com/CMA-ES/pycma/releases/tag/r2.7.0) logger now writes into a folder, new fitness model module, various fixes.\n\n* [Release ``2.6.1``](https://github.com/CMA-ES/pycma/releases/tag/r2.6.1) allow possibly much larger condition numbers, fix corner case with growing more-to-write list.\n\n* [Release ``2.6.0``](https://github.com/CMA-ES/pycma/releases/tag/r2.6.0) allows initial solution `x0` to be a callable.\n\n* Version ``2.4.2`` added the function `cma.fmin2` which, similar to `cma.purecma.fmin`, \n  returns ``(x_best:numpy.ndarray, es:cma.CMAEvolutionStrategy)``  instead of a 10-tuple\n  like `cma.fmin`. The result 10-tuple is accessible in [``es.result``](https://github.com/CMA-ES/pycma/blob/025ef1fed91c86690a21e9ed81713062d29398ff/cma/evolution_strategy.py#L942)``:``[``namedtuple``](https://docs.python.org/3/library/collections.html#collections.namedtuple).\n  \n* Version ``2.4.1`` included ``bbob`` testbed.\n\n* Version ``2.2.0`` added VkD CMA-ES to the master branch.\n\n* Version ``2.*`` is a multi-file split-up of the original module.\n\n* Version ``1.x.*`` is a one file implementation and not available in the history of\n  this repository. The latest ``1.*`` version ``1.1.7`` can be found\n  [here](https://pypi.python.org/pypi/cma/1.1.7).\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCMA-ES%2Fpycma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCMA-ES%2Fpycma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCMA-ES%2Fpycma/lists"}