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.kto some multiple of the number of cores you have designated for this process. Must belower than, and preferrably some multiple ofiters.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.
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
)
#>
#> Running initial scoring function 3 times in 1 thread(s)...
Results <- addIterations(Results,iters.n=1)
#>
#> Starting Epoch 2
#> 1) Fitting Gaussian Process...
#> 2) Running local optimum search... 0.051 seconds
#> 3) Running FUN 1 times in 1 thread(s)...