Skip to content

Commit f135458

Browse files
committed
fix: set check_values to FALSE to improve runtime of AcqFunction
1 parent f4e7a20 commit f135458

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

R/AcqFunction.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ AcqFunction = R6Class("AcqFunction",
6262
self$surrogate_max_to_min = surrogate_mult_max_to_min(surrogate)
6363
domain = generate_acq_domain(surrogate)
6464
}
65-
super$initialize(id = id, domain = domain, codomain = codomain, constants = constants, label = label, man = man)
65+
super$initialize(id = id, domain = domain, codomain = codomain, constants = constants, check_values = FALSE, label = label, man = man)
6666
},
6767

6868
#' @description

README.Rmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ output: github_document
55
```{r, include = FALSE}
66
lgr::get_logger("mlr3")$set_threshold("warn")
77
lgr::get_logger("bbotk")$set_threshold("warn")
8-
98
```
109

1110
# mlr3mbo
@@ -56,7 +55,7 @@ obfun = ObjectiveRFun$new(
5655
domain = ps(x = p_dbl(lower = -10, upper = 10)),
5756
codomain = ps(y1 = p_dbl(tags = "minimize")))
5857
59-
instance = OptimInstanceSingleCrit$new(
58+
instance = oi(
6059
objective = obfun,
6160
terminator = trm("evals", n_evals = 10))
6261

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ vignette](https://mlr3mbo.mlr-org.com/dev/articles/mlr3mbo.html).
2525
`mlr3mbo` is built modular relying on the following
2626
[R6](https://cran.r-project.org/package=R6) classes:
2727

28-
- `Surrogate`: Surrogate Model
29-
- `AcqFunction`: Acquisition Function
30-
- `AcqOptimizer`: Acquisition Function Optimizer
28+
- `Surrogate`: Surrogate Model
29+
- `AcqFunction`: Acquisition Function
30+
- `AcqOptimizer`: Acquisition Function Optimizer
3131

3232
Based on these, Bayesian Optimization loops can be written, see, e.g.,
3333
`bayesopt_ego` for sequential single-objective BO.
@@ -58,7 +58,7 @@ obfun = ObjectiveRFun$new(
5858
domain = ps(x = p_dbl(lower = -10, upper = 10)),
5959
codomain = ps(y1 = p_dbl(tags = "minimize")))
6060

61-
instance = OptimInstanceSingleCrit$new(
61+
instance = oi(
6262
objective = obfun,
6363
terminator = trm("evals", n_evals = 10))
6464

@@ -77,6 +77,7 @@ optimizer$optimize(instance)
7777
```
7878

7979
## x x_domain y1
80+
## <num> <list> <num>
8081
## 1: 0.03897209 <list[1]> 0.001518824
8182

8283
Note that you can also use `bb_optimize` as a shorthand:
@@ -133,4 +134,5 @@ instance$result
133134
```
134135

135136
## cp learner_param_vals x_domain classif.ce
136-
## 1: -4.594102 <list[2]> <list[1]> 0.2109375
137+
## <num> <list> <list> <num>
138+
## 1: -4.381681 <list[2]> <list[1]> 0.2070312

0 commit comments

Comments
 (0)