CR-FM-NES C# implementation
Please run the following command.
$ nuget install CRFMNES
Alternatively, you can download it directly.
This is a simple example that objective function is sphere function.
using System;
using CRFMNES;
using CRFMNES.Utils;
class MainClass
{
public static void Main(string[] args)
{
double Sphere(Vector x) => x & x;
int dim = 3;
Vector mean = Vector.Fill(dim, 0.5);
double sigma = 0.2;
int lamb = 6;
Optimizer optimizer = new Optimizer(dim, Sphere, mean, sigma, lamb);
for (int i = 0; i < 100; ++i)
{
optimizer.OneIteration();
}
Console.WriteLine("x_best: {0}, f_best: {1}", optimizer.XBest, optimizer.FBest);
}
}
# x_best: Vector(-4.75987117170772E-12, -1.34712992796176E-11, 2.46825317903529E-11), f_best: 8.13359653434064E-22
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License - see the LICENSE file for details