|
56 | 56 | #' Increase this for a higher chance to find global optimum, at the expense of more time. |
57 | 57 | #' @param convThresh convergence threshold passed to \code{factr} when the \code{optim} function (L-BFGS-B) is called. |
58 | 58 | #' Lower values will take longer to converge, but may be more accurate. |
59 | | -#' @param minClusterUtility the minimum percentage of the optimal utility required for a less optimal local |
60 | | -#' maximum to be included as a candidate parameter set in the next scoring function. If \code{NULL}, |
61 | | -#' only the global optimum will be used as a candidate parameter set. |
| 59 | +#' @param minClusterUtility number 0-1. Represents the minimum percentage of the optimal utility |
| 60 | +#' required for a less optimal local maximum to be included as a candidate parameter |
| 61 | +#' set in the next scoring function. If \code{NULL}, only the global optimum will be |
| 62 | +#' used as a candidate parameter set. |
62 | 63 | #' @param noiseAdd if bulkNew > 1, specifies how much noise to add to the optimal candidate parameter set |
63 | 64 | #' to obtain the other \code{bulkNew-1} candidate parameter sets. New random draws are pulled from |
64 | 65 | #' a shape(4,4) beta distribution centered at the optimal candidate parameter set |
65 | 66 | #' with a range equal to \code{noiseAdd*(Upper Bound - Lower Bound)} |
66 | 67 | #' @param verbose Whether or not to print progress. If 0, nothing will be printed. |
67 | 68 | #' If 1, progress will be printed. If 2, progress and information about new parameter-score pairs will be printed. |
68 | 69 | #' @return A list containing details about the process: |
69 | | -#' \item{GPlist}{ The list of the gaussian process objects that were fit.} |
70 | | -#' \item{OptParDT}{ The optimal parameters according to each gaussian process} |
71 | | -#' \item{ScoreDT}{ A list of all parameter-score pairs, as well as extra columns from FUN} |
72 | | -#' \item{BestPars}{ The best parameter set at each iteration} |
| 70 | +#' \item{GPlist}{The list of the gaussian process objects that were fit.} |
| 71 | +#' \item{acqMaximums}{The optimal parameters according to each gaussian process} |
| 72 | +#' \item{ScoreDT}{A list of all parameter-score pairs, as well as extra columns from FUN} |
| 73 | +#' \item{BestPars}{The best parameter set at each iteration} |
73 | 74 | #' @references Jasper Snoek, Hugo Larochelle, Ryan P. Adams (2012) \emph{Practical Bayesian Optimization of Machine Learning Algorithms} |
74 | 75 | #' @examples |
75 | 76 | #' \dontrun{ |
@@ -199,7 +200,7 @@ BayesianOptimization <- function( |
199 | 200 | if (nrow(leftOff) > 0){ |
200 | 201 | if (sum(sapply(ParamNames, CheckBounds,leftOff, bounds))>0) stop("leftOff not within bounds.") |
201 | 202 | } |
202 | | - if (nrow(leftOff)+initPoints+nrow(initGrid) >= nIters) stop("Rows in initial set will be larger than nIters") |
| 203 | + if (nrow(leftOff)+initialize*(initPoints+nrow(initGrid)) >= nIters) stop("Rows in initial set will be larger than nIters") |
203 | 204 | if (verbose > 0 & bulkNew < Workers & parallel) cat("bulkNew is less than the threads registered on the parallel back end - process may not utilize all workers.\n") |
204 | 205 |
|
205 | 206 |
|
@@ -319,7 +320,7 @@ BayesianOptimization <- function( |
319 | 320 | , convThresh = convThresh |
320 | 321 | ) |
321 | 322 |
|
322 | | - if (sum(LocalOptims$gradCount > 2) == 0) cat("\n 2a) WARNING - No initial points converged.\n Process may just be sampling random points.\n Try decreasing convThresh.") |
| 323 | + if (sum(LocalOptims$gradCount > 2) == 0) stop("\n 2a) WARNING - No initial points converged.\n Process may just be sampling random points.\n Try decreasing convThresh.") |
323 | 324 |
|
324 | 325 | fromCluster <- applyCluster() |
325 | 326 | acqMaximums <- rbind(acqMaximums, data.table("Iteration" = Iter, fromCluster$clusterPoints)) |
|
0 commit comments