Skip to content

bakanaouji/CRFMNES_CS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRFMNES_CS

CR-FM-NES C# implementation

Getting Started

Installing

Please run the following command.

$ nuget install CRFMNES

Alternatively, you can download it directly.

Example

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

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

About

CR-FM-NES implemented by C#

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published