mlr-org / bbotk

Black-box optimization framework for R.
https://bbotk.mlr-org.com
GNU Lesser General Public License v3.0
20 stars 9 forks source link

fix: parameters of GenSA #182

Closed sumny closed 2 years ago

sumny commented 2 years ago

Did a small benchmark on xgboost comparing some optimizers on 2D, 3D, 5D problems on 10 tasks and default GenSA performs very poorly (y-axis is mean normalized regret over the mean of the 10 repls over the 30 problems in total):

image

Small ablation on 3 of the problems where GenSA performed worst shows that if you set smooth = FALSE you get quite some performance boosts (GenSAv2 or GenSAv4; GenSAv3 is the current default):

image

The four versions are constructed w.r.t smooth and simple.function (full factorial design: v1 TRUE/TRUE, v2 FALSE/TRUE, v3 TRUE/FALSE, v4 FALSE/FALSE) but simple.function does not have a strong effect.

smooth is not really explained in the docs of GenSA but what happens is: If FALSE switches the local search algorithm from using L-BFGS-B (default) to Nelder-Mead that works better when the objective function has very few places where numerical derivatives can be computed. I would say that numerical derivatives are quite hard to compute in HPO problems (noisy, resampling, etc.) and therefore argue to go with smooth = FALSE (in mlr3tuning; here in bbotk I suggest we keep things as before but I added a comment in the docs).