CMA-ES / pycma

Python implementation of CMA-ES
Other
1.08k stars 177 forks source link

Undesired CSA behavior with large population size #231

Open nikohansen opened 1 year ago

nikohansen commented 1 year ago

on the BBOB Rastrigin function F15.

import cocoex

suite = cocoex.Suite('bbob', '', '')
N = 40
fbbob = suite.get_problem_by_function_dimension_instance(15, N, 1)

CMA-ES with popsize=3999 will increase the initial standard deviation by almost a factor of 1000 when the initial point is chosen like

x0 = 8 * np.random.rand(N)

Strangely enough, and remarkably, this does not happen on the cma.ff.rastrigin function. issue

Strangely enough, we see even full-blown divergence with TPA (and no problem on ff.rastrigin).

nikohansen commented 1 year ago

Changing the damping factor by just 1.5 (usually) fixes this specific case with CSA (and for TPA a factor of 2 from 4.5 to 9):

Screenshot 2023-04-05 at 11 45 41
nikohansen commented 1 year ago

A little additional insight: this happens on F3 and F12 too (and arguably on F6), and it depends on the initial point in a peculiar way only when initialized badly, here on F3 in the all-positive domain. p1259 p2222

nikohansen commented 9 months ago

As a poor temporary band-aid, the TPA damping is changed from 0.7 + np.log(eval('N')) to 0.7 + 2 * np.log(eval('N')) with commit 38b9845