crfmnes


Namecrfmnes JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/nmasahiro/crfmnes
SummaryCR-FM-NES for numerical optimization in Python
upload_time2023-01-12 04:00:44
maintainerMasahiro Nomura
docs_urlNone
authorMasahiro Nomura
requires_python
licenseMIT
keywords optimization cr-fm-nes
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CR-FM-NES [[slide]](slide_cec2022.pdf)

[CR-FM-NES](https://arxiv.org/abs/2201.11422) [1] implementation.
The main feature of CR-FM-NES is that both time and space complexity are linear, with partially considering variable dependencies.
Therefore, it is especially suitable for high-dimensional problems (about hundreds to thousands of dimensions).
On the other hand, it often achieves high performance even on low-dimensional problems.
This is an extension of [FM-NES (Fast Moving Natural Evolution Strategy)](https://arxiv.org/abs/2108.09455) [2] to be
applicable in high-dimensional problems.
Please e-mail at masahironomura5325@gmail.com if you have any issue.

<img width="1215" alt="188303830-aa7b11d0-c6ff-4d1a-9bd8-2ccbf4d7e2dd" src="https://user-images.githubusercontent.com/10880858/211967554-65d632bd-3e77-4725-998c-20f69bb8f5ce.png">

If you find this code useful in your research then please cite:
```bibtex
@INPROCEEDINGS{nomura2022fast,
  title={Fast Moving Natural Evolution Strategy for High-Dimensional Problems},
  author={Nomura, Masahiro and Ono, Isao},
  booktitle={2022 IEEE Congress on Evolutionary Computation (CEC)}, 
  pages={1-8},
  year={2022},
}
```

## News
* **(2022/07)** The paper [Fast Moving Natural Evolution Strategy for High-Dimensional Problems](https://arxiv.org/abs/2201.11422) has been accepted at IEEE CEC'22.
* **(2022/12)** CR-FM-NES has been integrated into [evosax](https://github.com/RobertTLange/evosax), which provides JAX-based evolution strategies implementation. Thanks [@RobertTLange](https://github.com/RobertTLange) and [@Obliman](https://github.com/Obliman)!


## Getting Started


### Prerequisites

You need only [NumPy](http://www.numpy.org/) that is the package for scientific computing.

### Installing

Please run the following command.

```bash
$ pip install crfmnes
```

## Example

This is a simple example that objective function is sphere function.
Note that the optimization problem is formulated as **minimization** problem.

```python
import numpy as np
from crfmnes import CRFMNES

dim = 3
f = lambda x: np.sum(x**2)
mean = np.ones([dim, 1]) * 0.5
sigma = 0.2
lamb = 6
crfmnes = CRFMNES(dim, f, mean, sigma, lamb)

x_best, f_best = crfmnes.optimize(100)
print("x_best:{}, f_best:{}".format(x_best, f_best))
# x_best:[1.64023896e-05 2.41682149e-05 3.40657594e-05], f_best:2.0136169613476005e-09
```

## For Constrained Problems

CR-FM-NES can be applied to (implicitly) constrained black-box optimization problems.
Please set the objective function value of the infeasible solution to `np.inf`.
CR-FM-NES reflects the information and performs an efficient search. 
Please refer to [3] for the details of the constraint handling methods implemented in this repository.

## Other Versions of CR-FM-NES

I really appreciate that CR-FM-NES is implemented in other settings.

* C# Implementation: [bakanaouji/CRFMNES_CS](https://github.com/bakanaouji/CRFMNES_CS)
* C++ Implementation: [dietmarwo/fast-cma-es](https://github.com/dietmarwo/fast-cma-es/blob/master/_fcmaescpp/crfmnes.cpp)
* Jax(Python) Implementation: [RobertTLange/evosax](https://github.com/RobertTLange/evosax/blob/main/evosax/strategies/cr_fm_nes.py)


## References
* [1] [M. Nomura, I. Ono, Fast Moving Natural Evolution Strategy for High-Dimensional Problems, IEEE CEC, 2022.](https://arxiv.org/abs/2201.11422)
* [2] [M. Nomura, I. Ono, Natural Evolution Strategy for Unconstrained and Implicitly Constrained Problems with Ridge Structure, IEEE SSCI, 2021.](https://arxiv.org/abs/2108.09455)
* [3] [M. Nomura, N. Sakai, N. Fukushima, and I. Ono, Distance-weighted Exponential Natural Evolution Strategy for Implicitly Constrained Black-Box Function Optimization, IEEE CEC, 2021.](https://ieeexplore.ieee.org/document/9504865)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nmasahiro/crfmnes",
    "name": "crfmnes",
    "maintainer": "Masahiro Nomura",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "masahironomura5325@gmail.com",
    "keywords": "optimization,CR-FM-NES",
    "author": "Masahiro Nomura",
    "author_email": "masahironomura5325@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c6/4a/9c0c1aa1cc331095872b1602b59508d34208269d30eb9e3273608a657edb/crfmnes-1.0.0.tar.gz",
    "platform": null,
    "description": "# CR-FM-NES [[slide]](slide_cec2022.pdf)\n\n[CR-FM-NES](https://arxiv.org/abs/2201.11422) [1] implementation.\nThe main feature of CR-FM-NES is that both time and space complexity are linear, with partially considering variable dependencies.\nTherefore, it is especially suitable for high-dimensional problems (about hundreds to thousands of dimensions).\nOn the other hand, it often achieves high performance even on low-dimensional problems.\nThis is an extension of [FM-NES (Fast Moving Natural Evolution Strategy)](https://arxiv.org/abs/2108.09455) [2] to be\napplicable in high-dimensional problems.\nPlease e-mail at masahironomura5325@gmail.com if you have any issue.\n\n<img width=\"1215\" alt=\"188303830-aa7b11d0-c6ff-4d1a-9bd8-2ccbf4d7e2dd\" src=\"https://user-images.githubusercontent.com/10880858/211967554-65d632bd-3e77-4725-998c-20f69bb8f5ce.png\">\n\nIf you find this code useful in your research then please cite:\n```bibtex\n@INPROCEEDINGS{nomura2022fast,\n  title={Fast Moving Natural Evolution Strategy for High-Dimensional Problems},\n  author={Nomura, Masahiro and Ono, Isao},\n  booktitle={2022 IEEE Congress on Evolutionary Computation (CEC)}, \n  pages={1-8},\n  year={2022},\n}\n```\n\n## News\n* **(2022/07)** The paper [Fast Moving Natural Evolution Strategy for High-Dimensional Problems](https://arxiv.org/abs/2201.11422) has been accepted at IEEE CEC'22.\n* **(2022/12)** CR-FM-NES has been integrated into [evosax](https://github.com/RobertTLange/evosax), which provides JAX-based evolution strategies implementation. Thanks [@RobertTLange](https://github.com/RobertTLange) and [@Obliman](https://github.com/Obliman)!\n\n\n## Getting Started\n\n\n### Prerequisites\n\nYou need only [NumPy](http://www.numpy.org/) that is the package for scientific computing.\n\n### Installing\n\nPlease run the following command.\n\n```bash\n$ pip install crfmnes\n```\n\n## Example\n\nThis is a simple example that objective function is sphere function.\nNote that the optimization problem is formulated as **minimization** problem.\n\n```python\nimport numpy as np\nfrom crfmnes import CRFMNES\n\ndim = 3\nf = lambda x: np.sum(x**2)\nmean = np.ones([dim, 1]) * 0.5\nsigma = 0.2\nlamb = 6\ncrfmnes = CRFMNES(dim, f, mean, sigma, lamb)\n\nx_best, f_best = crfmnes.optimize(100)\nprint(\"x_best:{}, f_best:{}\".format(x_best, f_best))\n# x_best:[1.64023896e-05 2.41682149e-05 3.40657594e-05], f_best:2.0136169613476005e-09\n```\n\n## For Constrained Problems\n\nCR-FM-NES can be applied to (implicitly) constrained black-box optimization problems.\nPlease set the objective function value of the infeasible solution to `np.inf`.\nCR-FM-NES reflects the information and performs an efficient search. \nPlease refer to [3] for the details of the constraint handling methods implemented in this repository.\n\n## Other Versions of CR-FM-NES\n\nI really appreciate that CR-FM-NES is implemented in other settings.\n\n* C# Implementation: [bakanaouji/CRFMNES_CS](https://github.com/bakanaouji/CRFMNES_CS)\n* C++ Implementation: [dietmarwo/fast-cma-es](https://github.com/dietmarwo/fast-cma-es/blob/master/_fcmaescpp/crfmnes.cpp)\n* Jax(Python) Implementation: [RobertTLange/evosax](https://github.com/RobertTLange/evosax/blob/main/evosax/strategies/cr_fm_nes.py)\n\n\n## References\n* [1] [M. Nomura, I. Ono, Fast Moving Natural Evolution Strategy for High-Dimensional Problems, IEEE CEC, 2022.](https://arxiv.org/abs/2201.11422)\n* [2] [M. Nomura, I. Ono, Natural Evolution Strategy for Unconstrained and Implicitly Constrained Problems with Ridge Structure, IEEE SSCI, 2021.](https://arxiv.org/abs/2108.09455)\n* [3] [M. Nomura, N. Sakai, N. Fukushima, and I. Ono, Distance-weighted Exponential Natural Evolution Strategy for Implicitly Constrained Black-Box Function Optimization, IEEE CEC, 2021.](https://ieeexplore.ieee.org/document/9504865)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CR-FM-NES for numerical optimization in Python",
    "version": "1.0.0",
    "split_keywords": [
        "optimization",
        "cr-fm-nes"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "41950d6e27ac8875c8490fbedb77c21a30223168e7595f927a0e7a92b1c34597",
                "md5": "673333545835cc2032113e60fd99b1d9",
                "sha256": "f5a8d1c7c63e0e2cf38fb36238a47e879946b75443bfdcd2af40b3edbbdee338"
            },
            "downloads": -1,
            "filename": "crfmnes-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "673333545835cc2032113e60fd99b1d9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6913,
            "upload_time": "2023-01-12T04:00:43",
            "upload_time_iso_8601": "2023-01-12T04:00:43.063870Z",
            "url": "https://files.pythonhosted.org/packages/41/95/0d6e27ac8875c8490fbedb77c21a30223168e7595f927a0e7a92b1c34597/crfmnes-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c64a9c0c1aa1cc331095872b1602b59508d34208269d30eb9e3273608a657edb",
                "md5": "1cfd5e479cdc66e1447828f37b1e4ae0",
                "sha256": "7708326f984268e624fb1bd6a2bad4c99352a228b06972cb182d5a7ba7d86ac9"
            },
            "downloads": -1,
            "filename": "crfmnes-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1cfd5e479cdc66e1447828f37b1e4ae0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6840,
            "upload_time": "2023-01-12T04:00:44",
            "upload_time_iso_8601": "2023-01-12T04:00:44.812761Z",
            "url": "https://files.pythonhosted.org/packages/c6/4a/9c0c1aa1cc331095872b1602b59508d34208269d30eb9e3273608a657edb/crfmnes-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-12 04:00:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "nmasahiro",
    "github_project": "crfmnes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "crfmnes"
}
        
Elapsed time: 0.10362s