Returns all local optimums of the acquisition function, no matter the utility.
Usage
getLocalOptimums(
optObj,
bounds = optObj$bounds,
acq = optObj$optPars$acq,
kappa = optObj$optPars$kappa,
eps = optObj$optPars$eps,
convThresh = optObj$optPars$convThresh,
gsPoints = optObj$optPars$gsPoints,
parallel = FALSE,
verbose = 1
)Arguments
- optObj
an object of class
bayesOpt. The following parameters are all defaulted to the options provided in this object, but can be manually specified.- bounds
Same as in
bayesOpt()- acq
Same as in
bayesOpt()- kappa
Same as in
bayesOpt()- eps
Same as in
bayesOpt()- convThresh
Same as in
bayesOpt()- gsPoints
Same as in
bayesOpt()- parallel
Same as in
bayesOpt()- verbose
Should warnings be shown before results are returned prematurely?
Value
A data table of local optimums, including the utility (gpUtility), the utility relative to the max utility (relUtility), and the steps taken in the L-BFGS-B method (gradCount).
Details
gsPoints points in the parameter space are randomly initialized, and
the L-BFGS-B method is used to find the closest local optimum to each point.
dbscan is then used to cluster points together which converged to the same
optimum - only unique optimums are returned.
Examples
scoringFunction <- function(x) {
a <- exp(-(2-x)^2)*1.5
b <- exp(-(4-x)^2)*2
c <- exp(-(6-x)^2)*1
return(list(Score = a+b+c))
}
bounds <- list(x = c(0,8))
Results <- bayesOpt(
FUN = scoringFunction
, bounds = bounds
, initPoints = 3
, iters.n = 2
, gsPoints = 10
)
#>
#> Running initial scoring function 3 times in 1 thread(s)...
print(getLocalOptimums(Results))
#> localOptimum x gpUtility relUtility gradCount
#> <int> <num> <num> <num> <num>
#> 1: 1 8.000000 0.2267489 0.4584404 2
#> 2: 2 5.871406 -0.2302110 -0.4654400 8
#> 3: 3 2.651372 0.4946093 1.0000000 16
#> 4: 4 4.222089 0.2671755 0.5401749 12