Skip to content

Commit 56a0df9

Browse files
Fixing documentation
1 parent ac2c211 commit 56a0df9

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

R/BayesianOptimization.R

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,21 @@
5656
#' Increase this for a higher chance to find global optimum, at the expense of more time.
5757
#' @param convThresh convergence threshold passed to \code{factr} when the \code{optim} function (L-BFGS-B) is called.
5858
#' 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.
6263
#' @param noiseAdd if bulkNew > 1, specifies how much noise to add to the optimal candidate parameter set
6364
#' to obtain the other \code{bulkNew-1} candidate parameter sets. New random draws are pulled from
6465
#' a shape(4,4) beta distribution centered at the optimal candidate parameter set
6566
#' with a range equal to \code{noiseAdd*(Upper Bound - Lower Bound)}
6667
#' @param verbose Whether or not to print progress. If 0, nothing will be printed.
6768
#' If 1, progress will be printed. If 2, progress and information about new parameter-score pairs will be printed.
6869
#' @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}
7374
#' @references Jasper Snoek, Hugo Larochelle, Ryan P. Adams (2012) \emph{Practical Bayesian Optimization of Machine Learning Algorithms}
7475
#' @examples
7576
#' \dontrun{
@@ -199,7 +200,7 @@ BayesianOptimization <- function(
199200
if (nrow(leftOff) > 0){
200201
if (sum(sapply(ParamNames, CheckBounds,leftOff, bounds))>0) stop("leftOff not within bounds.")
201202
}
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")
203204
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")
204205

205206

@@ -319,7 +320,7 @@ BayesianOptimization <- function(
319320
, convThresh = convThresh
320321
)
321322

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

324325
fromCluster <- applyCluster()
325326
acqMaximums <- rbind(acqMaximums, data.table("Iteration" = Iter, fromCluster$clusterPoints))

R/applyCluster.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ applyCluster <- function(e = parent.frame()) {
3030
clusterPoints <- head(clusterPoints[get("GP_Utility") >= e$minClusterUtility,
3131
][order(-get("GP_Utility"))]
3232
,e$runNew)
33-
drop <- c("GP_Utility","Cluster") # So data.table doesn't throw an error.
33+
drop <- c("GP_Utility","Cluster") # So data.table doesn't throw a warning
3434

3535
}
3636

man/BayesianOptimization.Rd

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)