mies_step_fidelity | R Documentation |
As part of the "rolling-tide" multifidelity-setup, do reevaluation of configurations with
higher fidelity that have survived lower-fidelity selection. The evaluations are done as part of the
current generation, so the dob
value is not increased.
This function should only be called when doing rolling-tide multifidelity, and should not be part of the MIES cycle otherwise.
mies_step_fidelity(
inst,
budget_id,
fidelity,
current_gen_only = FALSE,
fidelity_monotonic = TRUE,
additional_components = NULL
)
inst |
( |
budget_id |
( |
fidelity |
( |
current_gen_only |
( |
fidelity_monotonic |
( |
additional_components |
( |
invisible data.table
: the performance values returned when evaluating the offspring
values
through eval_batch
.
Other mies building blocks:
mies_evaluate_offspring()
,
mies_generate_offspring()
,
mies_get_fitnesses()
,
mies_init_population()
,
mies_select_from_archive()
,
mies_survival_comma()
,
mies_survival_plus()
library("bbotk")
lgr::threshold("warn")
# Define the objective to optimize
objective <- ObjectiveRFun$new(
fun = function(xs) {
z <- exp(-xs$x^2 - xs$y^2) + 2 * exp(-(2 - xs$x)^2 - (2 - xs$y)^2)
list(Obj = z)
},
domain = ps(x = p_dbl(-2, 4), y = p_dbl(-2, 4)),
codomain = ps(Obj = p_dbl(tags = "maximize"))
)
# Get a new OptimInstance
oi <- OptimInstanceSingleCrit$new(objective,
terminator = trm("evals", n_evals = 100)
)
budget_id = "y"
# Create an initial population with fidelity ("y") value 1
mies_init_population(oi, mu = 2, budget_id = budget_id, fidelity = 1)
oi$archive
# Re-evaluate these individuals with higher fidelity
mies_step_fidelity(oi, budget_id = budget_id, fidelity = 2)
oi$archive
# The following creates a new generation without killing the initial
# generation
offspring = data.frame(x = 0:1)
mies_evaluate_offspring(oi, offspring = offspring, budget_id = budget_id,
fidelity = 3)
oi$archive
# Re-evaluate only individuals from last generation by setting current_gen_only
mies_step_fidelity(oi, budget_id = budget_id, fidelity = 4,
current_gen_only = TRUE)
oi$archive
# Default: Re-evaluate all that *increase* fidelity: Only the initial
# population is re-evaluated here.
mies_step_fidelity(oi, budget_id = budget_id, fidelity = 3)
oi$archive
# To also re-evaluate individuals with *higher* fidelity, use
# 'fidelity_monotonic = FALSE'. This does not re-evaluate the points that already have
# the requested fidelity, however.
mies_step_fidelity(oi, budget_id = budget_id, fidelity = 3, fidelity_monotonic = FALSE)
oi$archive
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.