Skip to content
CR-FM-NES implemented by Python
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci change yml Oct 21, 2018
crfmnes
examples add pytest Oct 21, 2018
tests
.gitignore
LICENSE fix name Oct 19, 2018
README.md fix typo in README.md Nov 2, 2018
requirements.txt add pytest Oct 21, 2018
setup.py

README.md

crfmnes

CR-FM-NES implementation

CircleCI

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.

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 for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE file for details

You can’t perform that action at this time.