Method clone()
The objects of this class are cloneable with this method.
-
Usage
+
Usage
Archive$clone(deep = FALSE)
-
Arguments
+
Arguments
deep
Whether to make a deep clone.
@@ -360,11 +228,11 @@
diff --git a/dev/reference/ArchiveAsync.html b/dev/reference/ArchiveAsync.html
new file mode 100644
index 00000000..12ad8c1a
--- /dev/null
+++ b/dev/reference/ArchiveAsync.html
@@ -0,0 +1,433 @@
+
+
Rush Data Storage — ArchiveAsync • bbotk
+
Skip to contents
+
+
+
+
+
+
+
+
The ArchiveAsync
stores all evaluated points and performance scores in a rush::Rush data base.
+
+
+
+
+
+
+
Public fields
+
rush
+(Rush
)
+Rush controller for parallel optimization.
+
+
+
+
+
+
Active bindings
+
data
+(data.table::data.table)
+Data table with all finished points.
+
+
+queued_data
+(data.table::data.table)
+Data table with all queued points.
+
+
+running_data
+(data.table::data.table)
+Data table with all running points.
+
+
+finished_data
+(data.table::data.table)
+Data table with all finished points.
+
+
+failed_data
+(data.table::data.table)
+Data table with all failed points.
+
+
+n_queued
+(integer(1)
)
+Number of queued points.
+
+
+n_running
+(integer(1)
)
+Number of running points.
+
+
+n_finished
+(integer(1)
)
+Number of finished points.
+
+
+n_failed
+(integer(1)
)
+Number of failed points.
+
+
+n_evals
+(integer(1)
)
+Number of evaluations stored in the archive.
+
+
+
+
+
+
Methods
+
+
Inherited methods
+
Method new()
+
Creates a new instance of this R6 class.
+
Usage
+
ArchiveAsync$new(search_space, codomain, check_values = FALSE, rush)
+
+
+
+
Arguments
+
search_space
+(paradox::ParamSet)
+Specifies the search space for the Optimizer. The paradox::ParamSet
+describes either a subset of the domain
of the Objective or it describes
+a set of parameters together with a trafo
function that transforms values
+from the search space to values of the domain. Depending on the context, this
+value defaults to the domain of the objective.
+
+
+codomain
+(paradox::ParamSet)
+Specifies codomain of function.
+Most importantly the tags of each output "Parameter" define whether it should
+be minimized or maximized. The default is to minimize each component.
+
+
+check_values
+(logical(1)
)
+Should points before the evaluation and the results be checked for validity?
+
+
+rush
+(Rush
)
+If a rush instance is supplied, the tuning runs without batches.
+
+
+
+
+
+
+
Method push_points()
+
Push queued points to the archive.
+
Usage
+
ArchiveAsync$push_points(xss)
+
+
+
+
Arguments
+
xss
+(list of named list()
)
+List of named lists of point values.
+
+
+
+
+
+
+
Method pop_point()
+
Pop a point from the queue.
+
+
+
+
Method push_running_point()
+
Push running point to the archive.
+
Usage
+
ArchiveAsync$push_running_point(xs, extra = NULL)
+
+
+
+
Arguments
+
xs
+(named list
)
+Named list of point values.
+
+
+extra
+(list()
)
+Named list of additional information.
+
+
+
+
+
+
+
Method push_result()
+
Push result to the archive.
+
Usage
+
ArchiveAsync$push_result(key, ys, x_domain, extra = NULL)
+
+
+
+
Arguments
+
key
+(character()
)
+Key of the point.
+
+
+ys
+(list()
)
+Named list of results.
+
+
+x_domain
+(list()
)
+Named list of transformed point values.
+
+
+extra
+(list()
)
+Named list of additional information.
+
+
+
+
+
+
+
Method push_failed_point()
+
Push failed point to the archive.
+
Usage
+
ArchiveAsync$push_failed_point(key, message)
+
+
+
+
+
+
Method data_with_state()
+
Fetch points with a specific state.
+
Usage
+
ArchiveAsync$data_with_state(
+ fields = c("xs", "ys", "xs_extra", "worker_extra", "ys_extra", "condition"),
+ states = c("queued", "running", "finished", "failed"),
+ reset_cache = FALSE
+)
+
+
+
+
Arguments
+
fields
+(character()
)
+Fields to fetch.
+Defaults to c("xs", "ys", "xs_extra", "worker_extra", "ys_extra")
.
+
+
+states
+(character()
)
+States of the tasks to be fetched.
+Defaults to c("queued", "running", "finished", "failed")
.
+
+
+reset_cache
+(logical(1)
)
+Whether to reset the cache of the finished points.
+
+
+
+
+
+
+
Method best()
+
Returns the best scoring evaluation(s).
+For single-crit optimization, the solution that minimizes / maximizes the objective function.
+For multi-crit optimization, the Pareto set / front.
+
Usage
+
ArchiveAsync$best(n_select = 1, ties_method = "first")
+
+
+
+
Arguments
+
n_select
+(integer(1L)
)
+Amount of points to select.
+Ignored for multi-crit optimization.
+
+
+ties_method
+(character(1L)
)
+Method to break ties when multiple points have the same score.
+Either "first"
(default) or "random"
.
+Ignored for multi-crit optimization.
+If n_select > 1L
, the tie method is ignored and the first point is returned.
+
+
+
+
+
+
+
+
+
Calculate best points w.r.t. non dominated sorting with hypervolume contribution.
+
Usage
+
ArchiveAsync$nds_selection(n_select = 1, ref_point = NULL)
+
+
+
+
Arguments
+
n_select
+(integer(1L)
)
+Amount of points to select.
+
+
+ref_point
+(numeric()
)
+Reference point for hypervolume.
+
+
+
+
+
+
+
+
Method clear()
+
Clear all evaluation results from archive.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/reference/ArchiveBatch.html b/dev/reference/ArchiveBatch.html
new file mode 100644
index 00000000..f10735db
--- /dev/null
+++ b/dev/reference/ArchiveBatch.html
@@ -0,0 +1,315 @@
+
+
Data Table Storage — ArchiveBatch • bbotk
+
Skip to contents
+
+
+
+
+
+
+
+
+
+
+
+
+
Public fields
+
data
+(data.table::data.table)
+Contains all performed Objective function calls.
+
+
+data_extra
+(named list
)
+Data created by specific Optimizer
s that does not relate to any individual function evaluation and can therefore not be held in $data
.
+Every optimizer should create and refer to its own entry in this list, named by its class()
.
+
+
+
+
+
+
Active bindings
+
n_evals
+(integer(1)
)
+Number of evaluations stored in the archive.
+
+
+n_batch
+(integer(1)
)
+Number of batches stored in the archive.
+
+
+
+
+
+
Methods
+
+
Inherited methods
+
Method new()
+
Creates a new instance of this R6 class.
+
Usage
+
ArchiveBatch$new(search_space, codomain, check_values = FALSE)
+
+
+
+
Arguments
+
search_space
+(paradox::ParamSet)
+Specifies the search space for the Optimizer. The paradox::ParamSet
+describes either a subset of the domain
of the Objective or it describes
+a set of parameters together with a trafo
function that transforms values
+from the search space to values of the domain. Depending on the context, this
+value defaults to the domain of the objective.
+
+
+codomain
+(paradox::ParamSet)
+Specifies codomain of function.
+Most importantly the tags of each output "Parameter" define whether it should
+be minimized or maximized. The default is to minimize each component.
+
+
+check_values
+(logical(1)
)
+Should x-values that are added to the archive be checked for validity?
+Search space that is logged into archive.
+
+
+
+
+
+
+
Method add_evals()
+
Adds function evaluations to the archive table.
+
Usage
+
ArchiveBatch$add_evals(xdt, xss_trafoed = NULL, ydt)
+
+
+
+
Arguments
+
xdt
+(data.table::data.table()
)
+Set of untransformed points / points from the search space.
+One point per row, e.g. data.table(x1 = c(1, 3), x2 = c(2, 4))
.
+Column names have to match ids of the search_space
.
+However, xdt
can contain additional columns.
+
+
+xss_trafoed
+(list()
)
+Transformed point(s) in the domain space.
+
+
+ydt
+(data.table::data.table()
)
+Optimal outcome.
+
+
+
+
+
+
+
Method best()
+
Returns the best scoring evaluation(s).
+For single-crit optimization, the solution that minimizes / maximizes the objective function.
+For multi-crit optimization, the Pareto set / front.
+
Usage
+
ArchiveBatch$best(batch = NULL, n_select = 1L, ties_method = "first")
+
+
+
+
Arguments
+
batch
+(integer()
)
+The batch number(s) to limit the best results to.
+Default is all batches.
+
+
+n_select
+(integer(1L)
)
+Amount of points to select.
+Ignored for multi-crit optimization.
+
+
+ties_method
+(character(1L)
)
+Method to break ties when multiple points have the same score.
+Either "first"
(default) or "random"
.
+Ignored for multi-crit optimization.
+If n_select > 1L
, the tie method is ignored and the first point is returned.
+
+
+
+
+
+
+
+
+
Calculate best points w.r.t. non dominated sorting with hypervolume contribution.
+
Usage
+
ArchiveBatch$nds_selection(batch = NULL, n_select = 1, ref_point = NULL)
+
+
+
+
Arguments
+
batch
+(integer()
)
+The batch number(s) to limit the best points to. Default is
+all batches.
+
+
+n_select
+(integer(1L)
)
+Amount of points to select.
+
+
+ref_point
+(numeric()
)
+Reference point for hypervolume.
+
+
+
+
+
+
+
+
Method clear()
+
Clear all evaluation results from archive.
+
+
+
+
Method clone()
+
The objects of this class are cloneable with this method.
+
Usage
+
ArchiveBatch$clone(deep = FALSE)
+
+
+
+
Arguments
+
deep
+Whether to make a deep clone.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/reference/CallbackAsync.html b/dev/reference/CallbackAsync.html
new file mode 100644
index 00000000..df6b87fa
--- /dev/null
+++ b/dev/reference/CallbackAsync.html
@@ -0,0 +1,179 @@
+
+
Create Asynchronous Optimization Callback — CallbackAsync • bbotk
+
Skip to contents
+
+
+
+
+
+
+
+
+
+
+
+
Public fields
+
on_optimization_begin
+(function()
)
+Stage called at the beginning of the optimization in the main process.
+Called in Optimizer$optimize()
.
+
+
+on_worker_begin
+(function()
)
+Stage called at the beginning of the optimization on the worker.
+Called in the worker loop.
+
+
+on_worker_end
+(function()
)
+Stage called at the end of the optimization on the worker.
+Called in the worker loop.
+
+
+on_result
+(function()
)
+Stage called after result are written.
+Called in OptimInstance$assign_result()
.
+
+
+on_optimization_end
+(function()
)
+Stage called at the end of the optimization in the main process.
+Called in Optimizer$optimize()
.
+
+
+
+
+
+
Methods
+
+
Inherited methods
+
Method clone()
+
The objects of this class are cloneable with this method.
+
Usage
+
CallbackAsync$clone(deep = FALSE)
+
+
+
+
Arguments
+
deep
+Whether to make a deep clone.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/reference/CallbackBatch.html b/dev/reference/CallbackBatch.html
new file mode 100644
index 00000000..5282a729
--- /dev/null
+++ b/dev/reference/CallbackBatch.html
@@ -0,0 +1,191 @@
+
+
Create Batch Optimization Callback — CallbackBatch • bbotk
+
Skip to contents
+
+
+
+
+
+
+
+
+
+
+
+
Public fields
+
on_optimization_begin
+(function()
)
+Stage called at the beginning of the optimization.
+Called in Optimizer$optimize()
.
+
+
+on_optimizer_before_eval
+(function()
)
+Stage called after the optimizer proposes points.
+Called in OptimInstance$eval_batch()
.
+
+
+on_optimizer_after_eval
+(function()
)
+Stage called after points are evaluated.
+Called in OptimInstance$eval_batch()
.
+
+
+on_result
+(function()
)
+Stage called after result are written.
+Called in OptimInstance$assign_result()
.
+
+
+on_optimization_end
+(function()
)
+Stage called at the end of the optimization.
+Called in Optimizer$optimize()
.
+
+
+
+
+
+
Methods
+
+
Inherited methods
+
Method clone()
+
The objects of this class are cloneable with this method.
+
Usage
+
CallbackBatch$clone(deep = FALSE)
+
+
+
+
Arguments
+
deep
+Whether to make a deep clone.
+
+
+
+
+
+
+
+
+
+
+
Examples
+
# write archive to disk
+callback_batch("bbotk.backup",
+ on_optimization_end = function(callback, context) {
+ saveRDS(context$instance$archive, "archive.rds")
+ }
+)
+#> <CallbackBatch:bbotk.backup>
+#> * Active Stages: on_optimization_end
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/reference/Codomain.html b/dev/reference/Codomain.html
index 1c4032a9..c0e6768f 100644
--- a/dev/reference/Codomain.html
+++ b/dev/reference/Codomain.html
@@ -4,7 +4,7 @@
"maximize". The codomain may contain extra parameters which are ignored
when calling the Archive methods $best(), $nds_selection() and
$cols_y. This class is usually constructed internally from a
-ParamSet when Objective is initialized.'>
Codomain of Function — Codomain • bbotkCodomain of Function — Codomain • bbotkbbotk: Black-Box Optimization Toolkit — bbotk-package • bbotkbbotk: Black-Box Optimization Toolkit — bbotk-package • bbotk
Skip to contents
-