CMA-ES / c-cmaes

CMA-ES written in ANSI C (yet fairly object-oriented)
Other
56 stars 26 forks source link

c-cmaes

CMA-ES written in ANSI C in a fairly object-oriented style.

For the general purpose of this software see doc.txt or here, for more documentation on this library see docfunctions.txt, for how to start see below.


Files in this Repository

Files You May Need to Edit

Output files written by cmaes_t


HOW TO START

0) get code via git ... or download button

A1) Take five minutes to look at file example_short.c.

A2) You might have a glance at the documentation provided in file docfunctions.txt.

A3) You might have a glance at cmaes_initials.par, where input parameters are defined.

B1) Compile and run the example program. Compilation e.g. with the GNU c-compiler in the src folder:

gcc -Wall -o evo cmaes.c example_short.c -lm

and run with evo or ./evo. Take a look at the output.

B2a) (optional but highly recommended: plotting) Invoke Scilab (freely available for Linux/Windows/Mac) or Matlab/Octave, change to the working directory and type (Scilab) getf('plotcmaesdat.sci'); plotcmaesdat; or (Matlab/Octave) plotcmaesdat; You need to have the file plotcmaesdat.sci or .m and the output data files in the working directory. You get a nice plot of the executed run. The same works with cma.py via python cma.py plot

B2b) (optional) Change (increase) problem dimension and/or problem number in file initials.par and re-run.

B2c) (optional) Change problem dimension in initials.par to 300 and change output verbosity via file signals.par while the program is running: change e.g. "print fewinfo 200" into "print fewinfo -200" and back. Read comments.

B2d) Change back problem dimension.

5) Now you are ready to inspect and edit example_restarts.c or example_boundary.c to plug in the function you want to optimize. Refer to doc.txt and see here for a practical issue on objective function design. Refer to docfunctions.txt to find more documentation about the functions in this package.

6) Check "obligatory settings" part in initials.par regarding your function. Make sure that the scale of all objective parameter components of the function is somewhat similar and sigma corresponds to about 1/4 of the respective search intervals.

7) output files are overwritten with each program call.

Questions? go here or send an email to hansen at lri dot fr.

See also: