Lower / Upper Confidence Bound.
Dictionary
This AcqFunction can be instantiated via the dictionary
mlr_acqfunctions or with the associated sugar function acqf()
:
$get("cb")
mlr_acqfunctionsacqf("cb")
References
Snoek, Jasper, Larochelle, Hugo, Adams, P R (2012). “Practical Bayesian Optimization of Machine Learning Algorithms.” In Pereira F, Burges CJC, Bottou L, Weinberger KQ (eds.), Advances in Neural Information Processing Systems, volume 25, 2951--2959.
Super classes
bbotk::Objective
-> mlr3mbo::AcqFunction
-> AcqFunctionCB
Methods
Method new()
Creates a new instance of this R6 class.
Usage
AcqFunctionCB$new(surrogate = NULL, lambda = 2)
Arguments
surrogate
(
NULL
| SurrogateLearner).lambda
(
numeric(1)
).
Examples
if (requireNamespace("mlr3learners") &
requireNamespace("DiceKriging") &
requireNamespace("rgenoud")) {
library(bbotk)
library(paradox)
library(mlr3learners)
library(data.table)
fun = function(xs) {
list(y = xs$x ^ 2)
}
domain = ps(x = p_dbl(lower = -10, upper = 10))
codomain = ps(y = p_dbl(tags = "minimize"))
objective = ObjectiveRFun$new(fun = fun, domain = domain, codomain = codomain)
instance = OptimInstanceSingleCrit$new(
objective = objective,
terminator = trm("evals", n_evals = 5))
instance$eval_batch(data.table(x = c(-6, -5, 3, 9)))
learner = lrn("regr.km",
covtype = "matern3_2",
optim.method = "gen",
nugget.stability = 10^-8,
control = list(trace = FALSE))
surrogate = srlrn(learner, archive = instance$archive)
acq_function = acqf("cb", surrogate = surrogate, lambda = 3)
acq_function$surrogate$update()
acq_function$eval_dt(data.table(x = c(-1, 0, 1)))
}
#> acq_cb
#> 1: -54.12988
#> 2: -54.53354
#> 3: -49.97450