Acquisition Function Wrapping Multiple Acquisition Functions
Source:R/AcqFunctionMulti.R
mlr_acqfunctions_multi.Rd
Wrapping multiple AcqFunctions resulting in a multi-objective acquisition function composed of the individual ones. Note that the optimization direction of each wrapped acquisition function is corrected for maximization.
For each acquisition function, the same Surrogate must be used. If acquisition functions passed during construction already have been initialized with a surrogate, it is checked whether the surrogate is the same for all acquisition functions. If acquisition functions have not been initialized with a surrogate, the surrogate passed during construction or lazy initialization will be used for all acquisition functions.
For optimization, AcqOptimizer can be used as for any other AcqFunction, however, the bbotk::Optimizer wrapped within the AcqOptimizer
must support multi-objective optimization as indicated via the multi-crit
property.
Dictionary
This AcqFunction can be instantiated via the dictionary
mlr_acqfunctions or with the associated sugar function acqf()
:
Super classes
bbotk::Objective
-> mlr3mbo::AcqFunction
-> AcqFunctionMulti
Active bindings
surrogate
(Surrogate)
Surrogate.acq_functions
(list of AcqFunction)
Points to the list of the individual acquisition functions.acq_function_ids
(character())
Points to the ids of the individual acquisition functions.
Methods
Method new()
Creates a new instance of this R6 class.
Usage
AcqFunctionMulti$new(acq_functions, surrogate = NULL)
Arguments
acq_functions
(list of AcqFunctions).
surrogate
(
NULL
| Surrogate).
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 = OptimInstanceBatchSingleCrit$new(
objective = objective,
terminator = trm("evals", n_evals = 5))
instance$eval_batch(data.table(x = c(-6, -5, 3, 9)))
learner = default_gp()
surrogate = srlrn(learner, archive = instance$archive)
acq_function = acqf("multi",
acq_functions = acqfs(c("ei", "pi", "cb")),
surrogate = surrogate
)
acq_function$surrogate$update()
acq_function$update()
acq_function$eval_dt(data.table(x = c(-1, 0, 1)))
}
#> acq_ei acq_pi acq_cb
#> <num> <num> <num>
#> 1: 4.400964 0.2666736 28.30071
#> 2: 4.864368 0.2939486 29.30224
#> 3: 5.296907 0.3509359 27.23262