Prime the given MiesOperator
s for an optimization run with the given search space.
In its simplest form, MIES optimization only optimizes the search space of the Objective
to be optimized. However,
more advanced optimization may handle a "budget" parameter for multi-fidelity optimization differently: It is still selected by Selector
s,
but not mutated or recombined and instead handled separately. It is also possible to add additional components to the search space that are
not evaluated by the objective function, but that are used for self-adaption by other operators.
The mies_prime_operators()
function uses the information that the user usually has readily at hand -- the Objective
s search space, the budget parameter, and additional components -- and primes [
Mutator], [
Recombinator], and [
Selector`] objects in the right way:
Selector
s are primed on a union of search_space
and additional_components
Mutator
s and Recombinator
s are primed on the Selector
's space with the budget_id
Param
removed.
mies_prime_operators()
is called with an arbitrary number of MiesOperator
arguments; typically one Mutator
, one Recombinator
and
at least two Selector
: one for survival selection, and one parent selection. Supplied MiesOperator
s are primed by-reference, but
they are also returned as invisible list
.
If neither additional components nor multi-fidelity optimization is used, it is also possible to use the $prime()
function of hte MiesOperator
s
directly, although using mies_prime_operators()
gives flexibility for future extension.
(ParamSet
)
Search space of the Objective
or OptimInstance
to be optimized.
(list
of Mutator
)Mutator
objects to prime. May be empty (default).
(list
of Recombinator
)Recombinator
objects to prime. May be empty (default).
(list
of Selector
)Selector
objects to prime. May be empty (default).
(list
of Filtor
)Filtor
objects to prime. May be empty (default).
(any)
Must not be given. Other operators may be added in the future, so the following arguments should be passed by name.
(ParamSet
| NULL
)
Additional components to optimize over, not included in search_space
, but possibly used for self-adaption. This must be the ParamSet
of mies_init_population()
's additional_component_sampler
argument.
(character(1)
| NULL
)
Budget component used for multi-fidelity optimization.
invisible
named list
with entries $mutators
(list
of Mutator
, primed mutators
), $recombinators
(list
of Recombinator
, primed recombinators
),
and $selectors
(list
of Selector
, primed selectors
).
# Search space of a potential TuningInstance for optimization:
search_space = ps(x = p_dbl(), y = p_dbl())
# Additoinal search space components that are not part of the TuningInstance
additional_components = ps(z = p_dbl())
# Budget parameter not subject to mutation or recombination
budget_id = "y"
m = mut("gauss")
r = rec("xounif")
s1 = sel("best")
s2 = sel("random")
f = ftr("null")
mies_prime_operators(search_space, mutators = list(m),
recombinators = list(r), selectors = list(s1, s2), filtors = list(f),
additional_components = additional_components, budget_id = budget_id
)
# contain search_space without budget parameter, with additional_components
m$primed_ps
#> <ParamSet>
#> id class lower upper nlevels
#> <char> <char> <num> <num> <num>
#> 1: x ParamDbl -Inf Inf Inf
#> 2: z ParamDbl -Inf Inf Inf
#> default
#> <list>
#> 1: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> 2: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> value
#> <list>
#> 1:
#> 2:
r$primed_ps
#> <ParamSet>
#> id class lower upper nlevels
#> <char> <char> <num> <num> <num>
#> 1: x ParamDbl -Inf Inf Inf
#> 2: z ParamDbl -Inf Inf Inf
#> default
#> <list>
#> 1: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> 2: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> value
#> <list>
#> 1:
#> 2:
# contain also the budget parameter
s1$primed_ps
#> <ParamSet>
#> id class lower upper nlevels
#> <char> <char> <num> <num> <num>
#> 1: x ParamDbl -Inf Inf Inf
#> 2: y ParamDbl -Inf Inf Inf
#> 3: z ParamDbl -Inf Inf Inf
#> default
#> <list>
#> 1: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> 2: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> 3: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> value
#> <list>
#> 1:
#> 2:
#> 3:
s2$primed_ps
#> <ParamSet>
#> id class lower upper nlevels
#> <char> <char> <num> <num> <num>
#> 1: x ParamDbl -Inf Inf Inf
#> 2: y ParamDbl -Inf Inf Inf
#> 3: z ParamDbl -Inf Inf Inf
#> default
#> <list>
#> 1: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> 2: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> 3: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> value
#> <list>
#> 1:
#> 2:
#> 3:
f$primed_ps
#> <ParamSet>
#> id class lower upper nlevels
#> <char> <char> <num> <num> <num>
#> 1: x ParamDbl -Inf Inf Inf
#> 2: y ParamDbl -Inf Inf Inf
#> 3: z ParamDbl -Inf Inf Inf
#> default
#> <list>
#> 1: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> 2: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> 3: <NoDefault>\n Public:\n clone: function (deep = FALSE) \n initialize: function ()
#> value
#> <list>
#> 1:
#> 2:
#> 3: