The OptimizerAsync implements the asynchronous optimization algorithm. The optimization is performed asynchronously on a set of workers.
The rush::rush_plan() function defines the number of workers and their type.
There are three types of workers:
"local": Workers are started as local processes with processx.
See $start_local_workers() in rush::Rush for more details.
"remote": Workers are started with mirai on local or remote machines.
mirai::daemons() must be created before starting the optimization.
See $start_remote_workers() in rush::Rush for more details.
"script": Workers are started by the user with a custom script.
See $create_worker_script() in rush::Rush for more details.
The workers are started when the $optimize() method is called.
The main process waits until at least one worker is running.
The optimization starts directly after the workers are running.
The main process prints the evaluation results and other log messages from the workers.
The optimization is terminated when the terminator criterion is satisfied.
The result is assigned to the OptimInstanceAsync field.
The main loop periodically checks the status of the workers.
If all workers crash the optimization is terminated.
The debug mode runs the optimization loop in the main process.
This is useful for debugging the optimization algorithm.
The debug mode is enabled by setting options(bbotk.debug = TRUE).
The tiny logging mode is enabled by setting the option bbotk.tiny_logging to TRUE.
In the tiny logging mode, the evaluated points are printed in a compact format and the currently best performing point is shown.
Deactivated depending parameters are not printed.
bbotk::Optimizer -> OptimizerAsync
optimize()Performs the optimization on a OptimInstanceAsyncSingleCrit or OptimInstanceAsyncMultiCrit until termination. The single evaluations will be written into the ArchiveAsync. The result will be written into the instance object.
OptimizerAsync$optimize(inst)inst(OptimInstanceAsyncSingleCrit | OptimInstanceAsyncMultiCrit).
clone()The objects of this class are cloneable with this method.
OptimizerAsync$clone(deep = FALSE)deepWhether to make a deep clone.
OptimizerAsync is the abstract base class for all asynchronous optimizers.
It provides the basic structure for asynchronous optimization algorithms.
The public method $optimize() is the main entry point for the optimization and runs in the main process.
The method starts the optimization process by starting the workers and pushing the necessary objects to the workers.
Optionally, a set of points can be created, e.g. an initial design, and pushed to the workers.
The private method $.optimize() is the actual optimization algorithm that runs on the workers.
Usually, the method proposes new points, evaluates them, and updates the archive.
OptimizerAsyncDesignPoints, OptimizerAsyncGridSearch, OptimizerAsyncRandomSearch