addIterations: Run Additional Optimization Iterations

View source: R/addIterations.R

addIterationsR Documentation

Run Additional Optimization Iterations

Description

Use this function to continue optimization of a bayesOpt object.

Usage

addIterations(
  optObj,
  iters.n = 1,
  iters.k = 1,
  otherHalting = list(timeLimit = Inf, minUtility = 0),
  bounds = optObj$bounds,
  acq = optObj$optPars$acq,
  kappa = optObj$optPars$kappa,
  eps = optObj$optPars$eps,
  gsPoints = optObj$optPars$gsPoints,
  convThresh = optObj$optPars$convThresh,
  acqThresh = optObj$optPars$acqThresh,
  errorHandling = "stop",
  saveFile = optObj$saveFile,
  parallel = FALSE,
  plotProgress = FALSE,
  verbose = 1,
  ...
)

Arguments

optObj

an object of class bayesOpt.

iters.n

The total number of additional times to sample the scoring function.

iters.k

integer that specifies the number of times to sample FUN at each Epoch (optimization step). If running in parallel, good practice is to set iters.k to some multiple of the number of cores you have designated for this process. Must belower than, and preferrably some multiple of iters.n.

otherHalting

Same as bayesOpt()

bounds

Same as bayesOpt()

acq

Same as bayesOpt()

kappa

Same as bayesOpt()

eps

Same as bayesOpt()

gsPoints

Same as bayesOpt()

convThresh

Same as bayesOpt()

acqThresh

Same as bayesOpt()

errorHandling

Same as bayesOpt()

saveFile

Same as bayesOpt()

parallel

Same as bayesOpt()

plotProgress

Same as bayesOpt()

verbose

Same as bayesOpt()

...

Same as bayesOpt()

Details

By default, this function uses the original parameters used to create optObj, however the parameters (including the bounds) can be customized. If new bounds are used which cause some of the prior runs to fall outside of the bounds, these samples are removed from the optimization procedure, but will remain in scoreSummary. FUN should return the same elements and accept the same inputs as the original, or this function may fail.

Value

An object of class bayesOpt having run additional iterations.

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 = 1
  , gsPoints = 10
)
Results <- addIterations(Results,iters.n=1)

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