getLocalOptimums: Get Local Optimums of acq From a bayesOpt Object

View source: R/getLocalOptimums.R

getLocalOptimumsR Documentation

Get Local Optimums of acq From a bayesOpt Object

Description

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?

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.

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).

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
)
print(getLocalOptimums(Results))

ParBayesianOptimization documentation built on Oct. 18, 2022, 5:07 p.m.