Welcome to lq-CMA-ES related stuff

Links

Code to run the algorithm

In [1]:
%pylab nbagg
figure(325);
Populating the interactive namespace from numpy and matplotlib
In [ ]:
import cma  # to install the module: "pip install cma" or "pip install --upgrade cma"
import cma.fitness_models

fun = cma.fitness_transformations.Function(cma.ff.rosen)  # to count proper evaluations
dimension = 10

es = cma.CMAEvolutionStrategy(dimension * [0.1], 0.1, {'ftarget':1e-11})
surrogate = cma.fitness_models.SurrogatePopulation(fun)
# surrogate = fun  # without surrogate
while not es.stop():
    X = es.ask()  # sample a new population
    F = surrogate(X)  # see Algorithm 1
    es.tell(X, F)  # update sample distribution
    if surrogate != fun:
        es.inject([surrogate.model.xopt])
    es.countevals = fun.evaluations  # record only "true" evaluations
    es.disp()  # just checking what's going on
    es.logger.add()
    es.logger.plot()  # plot in above figure

Click to see output

(5_w,10)-aCMA-ES (mu_w=3.2,w_1=45%) in dimension 10 (seed=129407, Thu Apr 16 10:31:14 2020)
Iterat #Fevals   function value  axis ratio  sigma  min&max std  t[m:s]
    1      5 1.051825097054228e+01 1.0e+00 9.46e-02  9e-02  1e-01 0:00.0
    2      6 1.511256412052086e+01 1.2e+00 9.63e-02  9e-02  1e-01 0:00.0
    3      7 1.431117668012353e+01 1.2e+00 9.50e-02  9e-02  1e-01 0:00.0
  100    174 7.801168830152305e+00 6.4e+00 1.35e-02  6e-03  2e-02 0:00.4
  200    277 6.689641772270440e+00 7.7e+00 1.96e-02  6e-03  2e-02 0:00.8
  300    381 5.143203232106320e+00 9.2e+00 4.19e-02  8e-03  3e-02 0:01.1
  400    523 3.654699875855813e+00 1.4e+01 7.28e-02  9e-03  3e-02 0:01.6
  500    661 2.013631847120232e+00 1.5e+01 1.73e-01  1e-02  4e-02 0:02.0
  600    781 9.237980850510487e-01 1.8e+01 1.41e-01  5e-03  2e-02 0:02.4
  700    910 1.882447880758025e-01 2.7e+01 7.31e-02  2e-03  1e-02 0:02.8
  800   1020 1.476851240155228e-02 5.1e+01 5.16e-02  7e-04  1e-02 0:03.2
  900   1158 3.569407249208212e-07 7.6e+01 1.24e-03  8e-06  3e-04 0:03.6
  942   1214 4.132932439385136e-12 7.3e+01 3.92e-05  2e-07  7e-06 0:03.8

Python Script to Run the Benchmarking

example_experiment2_lq_cma.py

Overview Scaling Data

click to expand

Code to use data in cocopp

In [3]:
import cocopp
qarch = cocopp.archiving.get('http://lq-cma.gforge.inria.fr/data-archives/lq-gecco2019')
qarch
Out[3]:
['CMA-ES__2019-gecco-surr.tgz',
 'SLSQP+CMA_2019-gecco-surr.tgz',
 'SLSQP-11_2019-gecco-surr.tgz',
 'lq-CMA-ES_2019-gecco-surr.tgz']
In [ ]:
cocopp.main(qarch.get_all('') + ['lmm-CMA'])  # add any data from the "official" archive