Skip to main content

CR-FM-NES for numerical optimization in Python

Project description

CR-FM-NES [slide]

CR-FM-NES [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) [2] to be applicable in high-dimensional problems. Please e-mail at masahironomura5325@gmail.com if you have any issue.

188303830-aa7b11d0-c6ff-4d1a-9bd8-2ccbf4d7e2dd

If you find this code useful in your research then please cite:

@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

Getting Started

Prerequisites

You need only NumPy that is the package for scientific computing.

Installing

Please run the following command.

$ 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.

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.

References

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

crfmnes-1.0.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

crfmnes-1.0.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file crfmnes-1.0.0.tar.gz.

File metadata

  • Download URL: crfmnes-1.0.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for crfmnes-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7708326f984268e624fb1bd6a2bad4c99352a228b06972cb182d5a7ba7d86ac9
MD5 1cfd5e479cdc66e1447828f37b1e4ae0
BLAKE2b-256 c64a9c0c1aa1cc331095872b1602b59508d34208269d30eb9e3273608a657edb

See more details on using hashes here.

File details

Details for the file crfmnes-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: crfmnes-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for crfmnes-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5a8d1c7c63e0e2cf38fb36238a47e879946b75443bfdcd2af40b3edbbdee338
MD5 673333545835cc2032113e60fd99b1d9
BLAKE2b-256 41950d6e27ac8875c8490fbedb77c21a30223168e7595f927a0e7a92b1c34597

See more details on using hashes here.

Supported by

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