You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,8 @@
15
15
- The `plot()` function has been updated to generate validation plots for DGP classifiers (i.e., DGP emulators with categorical likelihoods) and linked emulators created by `lgp()` using the new data frame form for `struc`.
16
16
- The `summary()` function has been redesigned to provide both summary tables and visualizations of structure and model specifications for (D)GP and linked (D)GP emulators.
17
17
- A `sample_size` argument has been added to the `validate()` and `plot()` functions, allowing users to adjust the number of samples used for validation when the validation method is set to `sampling`.
18
-
-The following functions are deprecated as of this version and will be removed in the next release: `combine()`, `set_linked_idx()`, `kernel()`, `Poisson()`, `Hetero()`, and `NegBin()`. These functions are no longer maintained. Please refer to the updated package documentation for alternative workflows.
19
-
- The basic node functions `kernel()`, `Hetero()`, `Poisson()`, and `NegBin()`, along with the `struc` argument in the `gp()` and `dgp()` functions, have been deprecated as of this version and will be removed in the next release. Customization of (D)GP specifications can be achieved by modifying the other arguments in `gp()` and `dgp()`.
18
+
-`combine()` and `set_linked_idx()` are deprecated as of this version and will be removed in the next release. These two functions are no longer maintained. Please refer to the updated package documentation for alternative workflows.
19
+
- The basic node functions `kernel()`, `Hetero()`, `Poisson()`, and `NegBin()`, along with the `struc` argument in the `gp()` and `dgp()` functions, have been removed as of this version. Customization of (D)GP specifications can be achieved by modifying the other arguments in `gp()` and `dgp()`.
20
20
- The `draw()` function has been updated for instances of the `bundle` class to allow drawing of design and evaluation plots of all emulators in a single figure.
21
21
- The `plot()` function has been updated for linked emulators generated by `lgp()` using the new data frame form for `struc`.
22
22
- The `design()` function has been redesigned to allow new specifications of the user-supplied `method` function.
@@ -28,6 +28,8 @@
28
28
- The `write()` function now allows `light = TRUE` for both GP emulators and bundles of GP emulators.
29
29
- Two new functions, `serialize()` and `deserialize()`, have been added to allow users to export emulators to multi-session workers for parallel processing.
30
30
- Additional vignettes are available, showcasing large-scale DGP emulation and DGP classification.
31
+
- Enhanced clarity and consistency across the documentation.
32
+
- Improved examples and explanations in vignettes for better user guidance.
31
33
32
34
# dgpsi 2.4.0
33
35
- One can now use `design()` to implement sequential designs using `f` and a fixed candidate set passed to `x_cand` with `y_cand = NULL`.
Copy file name to clipboardExpand all lines: R/alm.R
+28-25Lines changed: 28 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,10 @@
7
7
#' * the S3 class `gp`.
8
8
#' * the S3 class `dgp`.
9
9
#' * the S3 class `bundle`.
10
-
#' @param x_cand a matrix (with each row containing a design point and column representing an input dimension) that gives a candidate set
11
-
#' from which the next design point(s) are determined. If `object` is an instance of the `bundle` class and `aggregate` is not supplied, `x_cand` could also
12
-
#' be a list with length equal to the number of emulators contained in `object`. In this case, each slot in `x_cand` should be a candidate set matrix
13
-
#' for each emulator included in the bundle. Defaults to `NULL`.
10
+
#' @param x_cand a matrix (with each row being a design point and column being an input dimension) that gives a candidate set
11
+
#' from which the next design point(s) are determined. If `object` is an instance of the `bundle` class and `aggregate` is not supplied, `x_cand` can also be a list.
12
+
#' The list must have a length equal to the number of emulators in `object`, with each element being a matrix representing the candidate set for a corresponding
13
+
#' emulator in the bundle. Defaults to `NULL`.
14
14
#' @param n_start an integer that gives the number of initial design points to be used to determine next design point(s). This argument
15
15
#' is only used when `x_cand` is `NULL`. Defaults to `20`.
16
16
#' @param batch_size an integer that gives the number of design points to be chosen. Defaults to `1`.
@@ -33,37 +33,40 @@
33
33
#' of the matrix is equal to:
34
34
#' - the emulator output dimension if `object` is an instance of the `dgp` class; or
35
35
#' - the number of emulators contained in `object` if `object` is an instance of the `bundle` class.
36
-
#' * the output should be a vector that aggregates scores across outputs or emulators at different design points.
36
+
#' * the output should be a vector that gives aggregate scores at different design points.
37
37
#'
38
-
#' Set to `NULL` to disable the aggregation. Defaults to `NULL`.
38
+
#' Set to `NULL` to disable aggregation. Defaults to `NULL`.
39
39
#' @param ... any arguments (with names different from those of arguments used in [alm()]) that are used by `aggregate`
40
40
#' can be passed here.
41
41
#'
42
42
#' @return
43
-
#' 1. If `x_cand` is not `NULL` and:
44
-
#' - `object` is an instance of the `gp` class, a vector is returned with length equal to `batch_size`, giving the positions (i.e., row numbers)
45
-
#' of next design points from `x_cand`.
46
-
#' - `object` is an instance of the `dgp` class, a vector is returned with length equal to `batch_size * D`, giving positions (i.e., row numbers)
47
-
#' of next design points from `x_cand` to be added to the DGP emulator. `D` equals to the number of output dimensions of the DGP
48
-
#' emulator if there is no likelihood layer in the hierarchy. If `object` is a DGP emulator with either `Hetero` or `NegBin` likelihood layer,
49
-
#' `D = 2`. If `object` is a DGP emulator with a `Categorical` likelihood layer, `D` equals to one (for binary output) or `K` (for multi-class output with `K` classes).
50
-
#' - `object` is an instance of the `bundle` class, a matrix is returned with row number equal to `batch_size` and column number equal to the number of
51
-
#' emulators in the bundle, giving positions (i.e., row numbers) of next design points from `x_cand` to be added to individual emulators.
52
-
#' 2. If `x_cand = NULL` and:
53
-
#' - `object` is an instance of the `gp` class, a matrix is returned with row number equal to `batch_size`, giving the next design points to be evaluated.
54
-
#' - `object` is an instance of the `dgp` class, a matrix is returned with row number equal to `batch_size * D` where `D` is the number of output dimensions of the DGP
55
-
#' emulator if no likelihood layer is included. If `object` is a DGP emulator with either `Hetero` or `NegBin` likelihood layer, `D = 2`. If `object` is a DGP emulator
56
-
#' with a `Categorical` likelihood layer, `D` equals to one (for binary output) or `K` (for multi-class output with `K` classes).
57
-
#' - `object` is an instance of the `bundle` class, a list is returned with the length equal to the number of
58
-
#' emulators in the bundle. Each element in the list is a matrix with row number equal to `batch_size`, giving next design points to be added to individual emulators.
43
+
#' 1. If `x_cand` is not `NULL`:
44
+
#' - When `object` is an instance of the `gp` class, a vector of length `batch_size` is returned, containing the positions
45
+
#' (row numbers) of the next design points from `x_cand`.
46
+
#' - When `object` is an instance of the `dgp` class, a vector of length `batch_size * D` is returned, containing the positions
47
+
#' (row numbers) of the next design points from `x_cand` to be added to the DGP emulator.
48
+
#' * `D` is the number of output dimensions of the DGP emulator if no likelihood layer is included.
49
+
#' * For a DGP emulator with a `Hetero` or `NegBin` likelihood layer, `D = 2`.
50
+
#' * For a DGP emulator with a `Categorical` likelihood layer, `D = 1` for binary output or `D = K` for multi-class output with `K` classes.
51
+
#' - When `object` is an instance of the `bundle` class, a matrix is returned with `batch_size` rows and a column for each emulator in
52
+
#' the bundle, containing the positions (row numbers) of the next design points from `x_cand` for individual emulators.
53
+
#' 2. If `x_cand` is `NULL`:
54
+
#' - When `object` is an instance of the `gp` class, a matrix with `batch_size` rows is returned, giving the next design points to be evaluated.
55
+
#' - When `object` is an instance of the `dgp` class, a matrix with `batch_size * D` rows is returned, where:
56
+
#' - `D` is the number of output dimensions of the DGP emulator if no likelihood layer is included.
57
+
#' - For a DGP emulator with a `Hetero` or `NegBin` likelihood layer, `D = 2`.
58
+
#' - For a DGP emulator with a `Categorical` likelihood layer, `D = 1` for binary output or `D = K` for multi-class output with `K` classes.
59
+
#' - When `object` is an instance of the `bundle` class, a list is returned with a length equal to the number of emulators in the bundle. Each
60
+
#' element of the list is a matrix with `batch_size` rows, where each row represents a design point to be added to the corresponding emulator.
59
61
#'
60
62
#' @note
61
-
#' The column order of the first argument of `aggregate` must be consistent with the order of emulator output dimensions (if `object` is an instance of the
62
-
#' `dgp` class), or the order of emulators placed in `object` if `object` is an instance of the `bundle` class.
63
+
#' The first column of the matrix supplied to the first argument of `aggregate` must correspond to the first output dimension of the DGP emulator
64
+
#' if `object` is an instance of the `dgp` class, and so on for subsequent columns and dimensions. If `object` is an instance of the `bundle` class,
65
+
#' the first column must correspond to the first emulator in the bundle, and so on for subsequent columns and emulators.
63
66
#' @references
64
67
#' MacKay, D. J. (1992). Information-based objective functions for active data selection. *Neural Computation*, **4(4)**, 590-604.
65
68
#'
66
-
#' @details See further examples and tutorials at <https://mingdeyu.github.io/dgpsi-R/>.
69
+
#' @details See further examples and tutorials at <`r get_docs_url()`>.
Copy file name to clipboardExpand all lines: R/design.R
+33-37Lines changed: 33 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -51,9 +51,9 @@
51
51
#' * if `object` is an instance of the `bundle` class, `y_test` is a matrix with each row representing the outputs for the corresponding row of `x_test` and each column representing the output of the different emulators in the bundle.
52
52
#'
53
53
#' Set to `NULL` for LOO-based emulator validation. Defaults to `NULL`. This argument is only used if `eval = NULL`.
54
-
#' @param reset A boolean or a vector of booleans indicating whether to reset the hyperparameters of the emulator(s) to their initial values (as set during initial construction) before re-fitting.
54
+
#' @param reset A bool or a vector of bools indicating whether to reset the hyperparameters of the emulator(s) to their initial values (as set during initial construction) before re-fitting.
55
55
#' The re-fitting occurs based on the frequency specified by `freq[1]`. This option is useful when hyperparameters are suspected to have converged to a local optimum affecting validation performance.
56
-
#' - If a single boolean is provided, it applies to every iteration of the sequential design.
56
+
#' - If a single bool is provided, it applies to every iteration of the sequential design.
57
57
#' - If a vector is provided, its length must equal `N` (even if the re-fit frequency specified in `freq[1]` is not 1) and it will apply to the corresponding iterations of the sequential design.
58
58
#'
59
59
#' Defaults to `FALSE`.
@@ -91,18 +91,18 @@
91
91
#'
92
92
#' If no custom function is provided, a built-in evaluation metric (RMSE or log-loss, in the case of DGP emulators with categorical likelihoods) will be used.
93
93
#' Defaults to `NULL`. See the *Note* section below for additional details.
94
-
#' @param verb a boolean indicating if trace information will be printed during the sequential design.
94
+
#' @param verb a bool indicating if trace information will be printed during the sequential design.
95
95
#' Defaults to `TRUE`.
96
96
#' @param autosave a list that contains configuration settings for the automatic saving of the emulator:
97
-
#' * `switch`: a boolean indicating whether to enable automatic saving of the emulator during sequential design. When set to `TRUE`,
97
+
#' * `switch`: a bool indicating whether to enable automatic saving of the emulator during sequential design. When set to `TRUE`,
98
98
#' the emulator in the final iteration is always saved. Defaults to `FALSE`.
99
99
#' * `directory`: a string specifying the directory path where the emulators will be stored. Emulators will be stored in a sub-directory
100
100
#' of `directory` named 'emulator-`id`'. Defaults to './check_points'.
101
101
#' * `fname`: a string representing the base name for the saved emulator files. Defaults to 'check_point'.
102
102
#' * `save_freq`: an integer indicating the frequency of automatic saves, measured in the number of iterations. Defaults to `5`.
103
-
#' * `overwrite`: a boolean value controlling the file saving behavior. When set to `TRUE`, each new automatic save overwrites the previous one,
103
+
#' * `overwrite`: a bool value controlling the file saving behavior. When set to `TRUE`, each new automatic save overwrites the previous one,
104
104
#' keeping only the latest version. If `FALSE`, each automatic save creates a new file, preserving all previous versions. Defaults to `FALSE`.
105
-
#' @param new_wave a boolean indicating whether the current call to [design()] will create a new wave of sequential designs or add the next sequence of designs to the most recent wave.
105
+
#' @param new_wave a bool indicating whether the current call to [design()] will create a new wave of sequential designs or add the next sequence of designs to the most recent wave.
106
106
#' This argument is relevant only if waves already exist in the emulator. Creating new waves can improve the visualization of sequential design performance across different calls
107
107
#' to [design()] via [draw()], and allows for specifying a different evaluation frequency in `freq`. However, disabling this option can help limit the number of waves visualized
108
108
#' in [draw()] to avoid issues such as running out of distinct colors for large numbers of waves. Defaults to `TRUE`.
@@ -123,9 +123,9 @@
123
123
#' if the DGP emulator was constructed without the Vecchia approximation. Otherwise, the number of processes is set to `max physical cores available %/% 2`.
124
124
#' Only use multiple processes when there is a large number of GP components in different layers and optimization of GP components
125
125
#' is computationally expensive. Defaults to `1`.
126
-
#' @param pruning a boolean indicating if dynamic pruning of DGP structures will be implemented during the sequential design after the total number of
126
+
#' @param pruning a bool indicating if dynamic pruning of DGP structures will be implemented during the sequential design after the total number of
127
127
#' design points exceeds `min_size` in `control`. The argument is only applicable to DGP emulators (i.e., `object` is an instance of `dgp` class)
128
-
#' produced by `dgp()` with `struc = NULL`. Defaults to `TRUE`.
128
+
#' produced by `dgp()`. Defaults to `TRUE`.
129
129
#' @param control a list that can supply any of the following components to control the dynamic pruning of the DGP emulator:
130
130
#' * `min_size`, the minimum number of design points required to trigger dynamic pruning. Defaults to 10 times the number of input dimensions.
131
131
#' * `threshold`, the \eqn{R^2} value above which a GP node is considered redundant. Defaults to `0.97`.
@@ -156,8 +156,8 @@
156
156
#' If `target` is not `NULL`, the following additional elements are also included:
157
157
#' - `target`: the target evaluating metric computed by the `eval` or built-in function to stop the sequential design.
158
158
#' - `reached`: indicates whether the `target` was reached at the end of the sequential design:
159
-
#' - a boolean if `object` is an instance of the `gp` or `dgp` class.
160
-
#' - a vector of booleans if `object` is an instance of the `bundle` class, with its length determined as follows:
159
+
#' - a bool if `object` is an instance of the `gp` or `dgp` class.
160
+
#' - a vector of bools if `object` is an instance of the `bundle` class, with its length determined as follows:
161
161
#' - equal to the number of emulators in the bundle when `eval = NULL`.
162
162
#' - equal to the length of the output from `eval` when a custom `eval` function is provided.
163
163
#' - a slot called `type` that gives the type of validation:
@@ -201,7 +201,7 @@
201
201
#' within `f` are handled by appropriately returning `NA`s.
202
202
#' * When defining `eval`, the output metric needs to be positive if [draw()] is used with `log = T`. And one needs to ensure that a lower metric value indicates
203
203
#' a better emulation performance if `target` is set.
204
-
#' @details See further examples and tutorials at <https://mingdeyu.github.io/dgpsi-R/>.
204
+
#' @details See further examples and tutorials at <`r get_docs_url()`>.
0 commit comments