Skip to contents

TunerAsyncMbo class that implements Asynchronous Model Based Optimization (AMBO). This is a minimal interface internally passing on to OptimizerAsyncMbo. For additional information and documentation see OptimizerAsyncMbo.

Currently, only single-objective optimization is supported and TunerAsyncMbo is considered an experimental feature and API might be subject to changes.

Defaults

All components have sensible defaults. For more information on the defaults for surrogate, acq_function, acq_optimizer, and result_assigner, see mbo_defaults.

Parameters

initial_design

data.table::data.table()
Initial design of the optimization. If NULL, a design of size design_size is generated with the specified design_function. Default is NULL.

design_size

integer(1)
Size of the initial design if it is to be generated. Default is 100.

design_function

character(1)
Sampling function to generate the initial design. Can be random paradox::generate_design_random, lhs paradox::generate_design_lhs, or sobol paradox::generate_design_sobol. Default is sobol.

n_workers

integer(1)
Number of parallel workers. If NULL, all rush workers specified via rush::rush_plan() are used. Default is NULL.

Active bindings

surrogate

(Surrogate | NULL)
The surrogate.

acq_function

(AcqFunction | NULL)
The acquisition function.

acq_optimizer

(AcqOptimizer | NULL)
The acquisition function optimizer.

result_assigner

(ResultAssigner | NULL)
The result assigner.

param_classes

(character())
Supported parameter classes that the optimizer can optimize. Determined based on the surrogate and the acq_optimizer. This corresponds to the values given by a paradox::ParamSet's $class field.

properties

(character())
Set of properties of the optimizer. Must be a subset of bbotk_reflections$optimizer_properties. MBO in principle is very flexible and by default we assume that the optimizer has all properties. When fully initialized, properties are determined based on the loop, e.g., the loop_function, and surrogate.

packages

(character())
Set of required packages. A warning is signaled prior to optimization if at least one of the packages is not installed, but loaded (not attached) later on-demand via requireNamespace(). Required packages are determined based on the acq_function, surrogate and the acq_optimizer.

Methods

Inherited methods


TunerAsyncMbo$new()

Creates a new instance of this R6 class.

Note that all the parameters below are simply passed to the OptimizerAsyncMbo and the respective fields are simply (settable) active bindings to the fields of the OptimizerAsyncMbo.

Usage

TunerAsyncMbo$new(
  surrogate = NULL,
  acq_function = NULL,
  acq_optimizer = NULL,
  param_set = NULL
)

Arguments

surrogate

(Surrogate | NULL)
The surrogate.

acq_function

(AcqFunction | NULL)
The acquisition function.

acq_optimizer

(AcqOptimizer | NULL)
The acquisition function optimizer.

param_set

(paradox::ParamSet)
Set of control parameters.


TunerAsyncMbo$print()

Print method.

Usage

TunerAsyncMbo$print()

Returns

(character()).


TunerAsyncMbo$reset()

Reset the tuner. Sets the following fields to NULL: surrogate, acq_function, acq_optimizer, result_assigner Resets parameter values design_size and design_function to their defaults.

Usage

TunerAsyncMbo$reset()


TunerAsyncMbo$clone()

The objects of this class are cloneable with this method.

Usage

TunerAsyncMbo$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# \donttest{
if (requireNamespace("rush") &
    requireNamespace("mlr3learners") &
    requireNamespace("DiceKriging") &
    requireNamespace("rgenoud")) {

  if (redis_available()) {

    library(mlr3)
    library(mlr3tuning)

    # single-objective
    task = tsk("wine")
    learner = lrn("classif.rpart", cp = to_tune(lower = 1e-4, upper = 1, logscale = TRUE))
    resampling = rsmp("cv", folds = 3)
    measure = msr("classif.acc")

    instance = TuningInstanceAsyncSingleCrit$new(
      task = task,
      learner = learner,
      resampling = resampling,
      measure = measure,
      terminator = trm("evals", n_evals = 10))

    mirai::daemons(2)
    rush::rush_plan(n_workers=2, worker_type = "mirai")

    tnr("async_mbo", design_size = 4, n_workers = 2)$optimize(instance)
    mirai::daemons(0)
  } else {
    message("Redis server is not available.\nPlease set up Redis prior to running the example.")
  }
}
# }