Skip to content

NimaMan/cma_es_py_wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python wrapper around the libcma (C++ implementation of the CMA-ES)

USage

def nfitfunc(x):
    val = 0.0
    n = len(x) 
    for i in range(0,n):
        val += x[i]*x[i]
    return val

if __name__ == "__main__":
    problem_dimension = 100
    number_of_optimization_episodes = 1000
    x0 = np.array([1]*problem_dimension)
    population_size = 50 
    seed = 0
    sigma = 0.1

    esopt = es.cma( x0=x0, sigma=sigma, population_size=population_size, seed=seed) 
    for _ in range(number_of_optimization_episodes):
        params = esopt.ask()
        fvals = []
        for p in params: 
            fvals.append(f(p))
        esopt.tell(fvals)
    
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages