3

I am trying to minimize a simple noisy function:

function(x,prec=10){x^2+rnorm(1)/(prec)}

The noise is moderate, i.e., it should be fairly easy to find the optimum at 0. enter image description here

What I consider important here, is that the noise is independent, i.e., repeatedly evaluating the same point would move you closer to the true (noiseless) value. The optimizer could take advantage of that. Bu I am not sure how.

I am using mlrMBO in R to optimize, but fail to get a good result. The code below estimates the min at 0.032, and increasing iters does not seem to improve the result at all.

library(mlrMBO)
f1<-function(x,prec=10){x^2+rnorm(1)/(prec)}
obj.fun = makeSingleObjectiveFunction(name = "noisy_parable", fn = f1,  par.set = makeNumericParamSet("x", 1, -3, 3), noisy = TRUE)
ctrl = makeMBOControl(final.method = "best.predicted", final.evals = 1)
ctrl = setMBOControlInfill(ctrl, crit = crit.eqi)
ctrl = setMBOControlTermination(ctrl, iters = 10)
configureMlr(on.learner.warning = "quiet", show.learner.output = FALSE)
set.seed(1)
res = mbo(obj.fun, control = ctrl, show.info = FALSE)
print(res$x)

My intuition would be that increasing iter could continue to improve the result up to an arbitrarily accurate result: The logic being that, as we're moving closer to the optimum, the optimizer could exploit the independence of the noise to increase accuracy by repeatedly evaluating the same/similar points.

I think this is a fairly generic setup (noisy optimization with independent noise), so I thought the optimizer would have this built in, controllable via a tuning parameter. If this is not the case, is there a way to implement this using mlrBMO?

Background: In my actual application evaluating the function is very costly (>2 seconds for a noise that roughly equals the example above), so I would gain a lot my starting of a noisy function and then only increase the precision (by repaetedly evaluating the same points) as I move closer to the optimum.

A related, more broadly framed (What is a good algorithm for this kind of problem?) is asked and answered by myself here: https://math.stackexchange.com/questions/3376670/efficient-algorithm-to-search-minimum-of-function-with-noise/3397309#3397309

sheß
  • 484
  • 4
  • 20
  • 1
    Could you post a complete example that allows to reproduce the behaviour please? – Lars Kotthoff Oct 14 '19 at 19:01
  • Sure, after my edit the code in the big block should be sufficient to reproduce the 0.032 – sheß Oct 14 '19 at 19:17
  • When do you consider the result to be good enough? You could tune certain MBO parameters or hyperparameters of the surrogate learner for this specific problem but what would this help for a new true black-box function where you don`t know the true optimum? – jakob-r Oct 14 '19 at 20:55
  • Given the amount of noise you're adding, the result doesn't seem that bad, i.e. the standard deviation is 0.1 and you're getting much closer.I don't think that you'll be able to improve on this significantly. – Lars Kotthoff Oct 14 '19 at 21:02
  • Adding to that: Try to do a t.test whether `f(0.1)` is significantly worse than `f(0)`. I didn`t do the math behind that but you would roughly need 23 samples. So you need more evaluations. A easy way would be to evaluate the function e.g. 10 times and return the mean. – jakob-r Oct 14 '19 at 21:13
  • Thanks for your thoughts @jakob-r. Sorry, maybe I wasn't clear enough. I edited my question to be more specific. In short: I'm considering a class of `f()` that have in common that by repeatetly evaluating a point I can average out the noise. So - oversimplifying- I am trying to find which parameter to tune that takes advantage of that. – sheß Oct 15 '19 at 09:01

0 Answers0