mlr_acqfunctions_multi | R Documentation |
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.
This AcqFunction can be instantiated via the dictionary
mlr_acqfunctions or with the associated sugar function acqf()
:
mlr_acqfunctions$get("multi") acqf("multi")
bbotk::Objective
-> mlr3mbo::AcqFunction
-> AcqFunctionMulti
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.
new()
Creates a new instance of this R6 class.
AcqFunctionMulti$new(acq_functions, surrogate = NULL)
acq_functions
(list of AcqFunctions).
surrogate
(NULL
| Surrogate).
update()
Update each of the wrapped acquisition functions.
AcqFunctionMulti$update()
clone()
The objects of this class are cloneable with this method.
AcqFunctionMulti$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other Acquisition Function:
AcqFunction
,
mlr_acqfunctions
,
mlr_acqfunctions_aei
,
mlr_acqfunctions_cb
,
mlr_acqfunctions_ehvi
,
mlr_acqfunctions_ehvigh
,
mlr_acqfunctions_ei
,
mlr_acqfunctions_eips
,
mlr_acqfunctions_mean
,
mlr_acqfunctions_pi
,
mlr_acqfunctions_sd
,
mlr_acqfunctions_smsego
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)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.