Skip to content

Commit 5c00e79

Browse files
committed
fix: assure that acquisition function candidates are always within bounds
1 parent 163138d commit 5c00e79

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

R/AcqOptimizer.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ AcqOptimizer = R6Class("AcqOptimizer",
207207
get_best(instance, is_multi_acq_function = is_multi_acq_function, evaluated = self$acq_function$archive$data, n_select = self$param_set$values$n_candidates, not_already_evaluated = FALSE)
208208
}
209209
}
210+
# the following is required to assure that evaluations of numerical gradient based methods that potentially evaluated out of bounds are not returned as out of bound but clipped to bounds
211+
for (param in names(which(instance$search_space$is_number))) {
212+
set(xdt, j = param, value = pmax(pmin(xdt[[param]], instance$search_space$upper[[param]]), instance$search_space$lower[[param]]))
213+
}
210214
#if (is_multi_acq_function) {
211215
# set(xdt, j = instance$objective$id, value = apply(xdt[, instance$objective$acq_function_ids, with = FALSE], MARGIN = 1L, FUN = c, simplify = FALSE))
212216
# for (acq_function_id in instance$objective$acq_function_ids) {

0 commit comments

Comments
 (0)