Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMAES infill opt should allow integer parameter optimization #475

Open
mb706 opened this issue Dec 19, 2019 · 5 comments
Open

CMAES infill opt should allow integer parameter optimization #475

mb706 opened this issue Dec 19, 2019 · 5 comments

Comments

@mb706
Copy link
Contributor

mb706 commented Dec 19, 2019

Performing mbo over integer parameter spaces with infill optimization "cmaes"

ps = makeParamSet(
  makeNumericParam("q", lower = -1, upper = 2),
  makeIntegerParam("v", lower = -2, upper = 3)
)
des = generateDesign(n = 7, par.set = ps)
des$y = c(1.20, 0.97, 0.91, 3.15, 0.58, 1.12, 0.50)
ctrl = makeMBOControl()
ctrl = setMBOControlInfill(ctrl, opt = "cmaes")
opt.state = initSMBO(par.set = ps, design = des, control = ctrl, minimize = TRUE, noisy = FALSE)
proposePoints(opt.state)

gives error

Error in cmaesr::cmaes(fn, start.point = start.point, monitor = NULL,  : 
  CMA-ES only works for objective functions with numeric parameters.

it would be nice of MBO to allow this and perform rounding instead.

@mb706 mb706 changed the title CMAES infill opt should allow infill optimization CMAES infill opt should allow integer parameter optimization Dec 19, 2019
@jakob-r
Copy link
Sponsor Member

jakob-r commented Jan 9, 2020

As I mentioned: Rounding afterwards is generally a bad idea in MBO since we don't know whether the acq values are better for ceil or floor.
There is even a paper on it that claimed this "realization" as a novelty when we already always did it correct in focussearch.
I think it was this one: https://arxiv.org/abs/1805.03463

@mb706
Copy link
Contributor Author

mb706 commented Jan 12, 2020

If I remember correctly there is some other infill opt that does perform rounding, though (I forgot which one)

@mb706
Copy link
Contributor Author

mb706 commented Jan 12, 2020

Ah ok I just read your response to #476. I assume performing rounding is not that much of a problem if the integer range is large. For small integer ranges I guess you could choose to do rounding before the surrogate evaluation to simulate a step function to the infill optimization function.

If you are sure you don't want to do rounding you can close this.

@jakob-r
Copy link
Sponsor Member

jakob-r commented Jan 13, 2020

I assume performing rounding is not that much of a problem if the integer range is large.

Let's put it into these words: If the function is more or less well behaved (i.e. not too jumpy) it should be okay to round.

I would accept a PR but would not bother to implement it myself.

@mb706
Copy link
Contributor Author

mb706 commented Sep 6, 2020

Workaround is to have continuous parameters with a round() trafo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants