Purpose

This vignette gives a short example of the usage of the adaptive infill criteria in mlrMBO.

Adaptive Infill Criteria

An adaptive infill criterion can change its behaviour based on the progress of the optimization. The progress has to be supplied by the termination criterion. All integrated termination criteria support this feature.

Exemplary Usage of the Adaptive CB

To specify which infill criterion should be used, the MBOControl object has to be extended by calling setMBOControlInfill(). In addition to the criterion you can also set the parameters of the infill criterion optimization. The criterion itself is created with makeMBOInfillCrit*(). The most common infill criteria are predefined like crit.ei and crit.cb2. See ?MBOInfillCrit for details.

ctrl = makeMBOControl()
ctrl = setMBOControlTermination(ctrl, iters = 10L)
ctrl = setMBOControlInfill(ctrl, crit = makeMBOInfillCritAdaCB(cb.lambda.start = 4, cb.lambda.end = 0.1))

This will lead to an CB infill criterion (\(CB(x) = \hat{\mu}(x) \pm \lambda * \hat{s}(x)\)) that will focus on uncertain regions in the beginning (cb.lambda.start = 4) and towards the end will have a stronger focus on areas close to the global minimum of the surrogate (cb.lambda.end = 0.1).

test.fun = makeSingleObjectiveFunction(
 fn = function(x) x[1]^2 * sin(3 * x[2]),
 par.set = makeNumericParamSet(lower = 0, upper = 1, len = 2L)
)

You can now start the optimization like usual:

res = mbo(test.fun, control = ctrl)

If we look at the OptPath we can see the different progress values and the resulting different values of lambda.

tail(as.data.frame(res$opt.path))
##              x1           x2            y dob eol error.message exec.time
## 13 1.709222e-01 3.315767e-05 2.906045e-06   5  NA          <NA>         0
## 14 1.295025e-01 8.443279e-01 9.588378e-03   6  NA          <NA>         0
## 15 9.034855e-07 3.963116e-01 7.574909e-13   7  NA          <NA>         0
## 16 1.780031e-05 1.426885e-01 1.315285e-10   8  NA          <NA>         0
## 17 7.734453e-02 2.116604e-05 3.798570e-07   9  NA          <NA>         0
## 18 4.974571e-05 8.838412e-01 1.164778e-09  10  NA          <NA>         0
##          adacb error.model train.time    prop.type propose.time         se
## 13 -0.07941560        <NA>      0.060 infill_adacb        0.296 0.05191575
## 14 -0.05742525        <NA>      0.084 infill_adacb        0.333 0.03896669
## 15 -0.03561000        <NA>      0.059 infill_adacb        0.298 0.05122828
## 16 -0.02551348        <NA>      0.058 infill_adacb        0.278 0.02848988
## 17 -0.01810210        <NA>      0.073 infill_adacb        0.317 0.02735206
## 18 -0.01358221        <NA>      0.064 infill_adacb        0.302 0.01770504
##             mean lambda
## 13 -0.0145209159   1.25
## 14 -0.0145618921   1.10
## 15  0.0130568653   0.95
## 16 -0.0027215747   0.80
## 17 -0.0003232589   0.65
## 18 -0.0047296912   0.50