Skip to content

using CMA ES in CERN's ROOT

Emmanuel Benazera edited this page May 15, 2014 · 32 revisions

This is support for black-box optimization with CMA-ES from within ROOT (http://root.cern.ch/drupal/).

This is a work in progress, support for ROOT is under continuous improvement

libcmaes can be used from CERN's ROOT6 as a replacement or addition to Minuit2 optimizer. It is designed to be used from ROOT6 exactly as Minuit2 is used, so code using Minuit2 should be easily run against CMA-ES.

Note: at this early stage, not all features of Minuit2, such as subroutines Minos and Contour, are ported to CMA-ES. This is a work in progress.

Below are instructions for testing it out.

Beware: at the moment support is alpha, this is NO production code

Building ROOT6 and libcmaes

As for now, the only way to use libcmaes is from ROOT6, using the following special repository, and compiling it from sources (1): https://github.com/beniz/root/tree/cmaes4root_master

Proceed with the following steps:

  • get and install libcmaes into your home repository (or globally on your system, remove the --prefix option to the configure script below):
./configure --prefix=/home/yourhome
make
make install
git clone https://github.com/beniz/root/tree/cmaes4root_master
cd root
./configure --enable-minuit2 --build=debug
make

use make -jx where x is the number of cores on your system in order to minimize the building time.

Running an example with CMA-ES

To run the basic fitting of a Gaussian, originally taken from Minuit2's tutorial files, do:

root
.L tutorials/fit/cmaesGausFit.C++g
cmaesGausFit()

You should see a plot similar to cmaes_gaus_fit_root_errors

(1) more convenient ways will be provided. (2) we recommend building support for both minuit2 (i.e. for comparison to CMA-ES) and debug.