Skip to main content

CR-FM-NES for numerical optimization in Python

Project description

# crfmnes

CR-FM-NES implementation

[![CircleCI](https://circleci.com/gh/nmasahiro/crfmnes/tree/master.svg?style=shield)](https://circleci.com/gh/nmasahiro/crfmnes/tree/master)


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

```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
```


## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/nmasahiro/crfmnes/tags).


## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/nmasahiro/crfmnes/blob/master/LISENCE) file for details


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for crfmnes, version 0.0.5
Filename, size & hash File type Python version Upload date
crfmnes-0.0.5-py3-none-any.whl (6.5 kB) View hashes Wheel py3
crfmnes-0.0.5.tar.gz (4.8 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page