BayesianOptimizationSolver

class BayesianOptimizationSolver @JvmOverloads constructor(problemDefinition: ProblemDefinition, evaluator: EvaluatorIfc, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = RNStreamProvider(), surrogate: SurrogateModelIfc = GaussianProcessModel(problemDefinition), acquisition: AcquisitionFunctionIfc = ExpectedImprovement(), acquisitionOptimizer: AcquisitionOptimizerIfc = SampledAcquisitionOptimizer(), hyperparameterFitter: HyperparameterFitterIfc = FixedHyperparameters(), initialDesign: InitialDesignIfc = LatinHyperCubeDesign(), incumbentRule: IncumbentRuleIfc = BestPosteriorMeanIncumbent(), initialDesignSize: Int = defaultInitialDesignSize, maximumIterations: Int = boDefaultMaxIterations, replicationsPerEvaluation: ReplicationPerEvaluationIfc, name: String? = null) : StochasticSolver(source)

A Bayesian Optimization (BO) solver for stochastic simulation optimization. BO is a sequential, model-based method for expensive, noisy objectives: it fits a probabilistic surrogate to the observed data and, each iteration, optimizes a cheap acquisition function over the surrogate (no simulation) to choose the single most promising point to evaluate next.

The loop:

  1. initializeIterations evaluates a space-filling initial design (one batch oracle call), fits the surrogate (and its hyperparameters), and records the incumbent.

  2. Each mainIteration: (optionally) refit hyperparameters, refit the surrogate to the archive, compute the incumbent, maximize the acquisition over the surrogate, and evaluate the chosen point — the only oracle call of the iteration.

Per-point observation noise is taken from each Solution's estimated response (sample variance divided by replication count), which is exactly what Gaussian-process regression needs for the stochastic setting. The best solution found is tracked automatically by the base class through the currentSolution setter. All randomness is drawn through the solver's single random number stream (rnStream).

Parameters

problemDefinition

the problem being solved

evaluator

the evaluator responsible for assessing the quality of solutions

streamNum

the random number stream number; 0 (the default) means the next available stream

streamProvider

the provider of random number streams; defaults to a fresh RNStreamProvider

surrogate

the surrogate model; defaults to a GaussianProcessModel

acquisition

the acquisition function; defaults to ExpectedImprovement

acquisitionOptimizer

the acquisition optimizer; defaults to SampledAcquisitionOptimizer

hyperparameterFitter

the surrogate hyperparameter fitter; defaults to FixedHyperparameters

initialDesign

the initial design strategy; defaults to LatinHyperCubeDesign

incumbentRule

the incumbent rule; defaults to BestPosteriorMeanIncumbent

initialDesignSize

the number of initial design points

maximumIterations

the maximum number of BO iterations (after the initial design)

replicationsPerEvaluation

strategy to determine the number of replications per evaluation

name

an optional name for the solver

Constructors

Link copied to clipboard
constructor(problemDefinition: ProblemDefinition, evaluator: EvaluatorIfc, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = RNStreamProvider(), surrogate: SurrogateModelIfc = GaussianProcessModel(problemDefinition), acquisition: AcquisitionFunctionIfc = ExpectedImprovement(), acquisitionOptimizer: AcquisitionOptimizerIfc = SampledAcquisitionOptimizer(), hyperparameterFitter: HyperparameterFitterIfc = FixedHyperparameters(), initialDesign: InitialDesignIfc = LatinHyperCubeDesign(), incumbentRule: IncumbentRuleIfc = BestPosteriorMeanIncumbent(), initialDesignSize: Int = defaultInitialDesignSize, maximumIterations: Int = boDefaultMaxIterations, replicationsPerEvaluation: ReplicationPerEvaluationIfc, name: String? = null)
constructor(problemDefinition: ProblemDefinition, evaluator: EvaluatorIfc, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = RNStreamProvider(), surrogate: SurrogateModelIfc = GaussianProcessModel(problemDefinition), acquisition: AcquisitionFunctionIfc = ExpectedImprovement(), acquisitionOptimizer: AcquisitionOptimizerIfc = SampledAcquisitionOptimizer(), hyperparameterFitter: HyperparameterFitterIfc = FixedHyperparameters(), initialDesign: InitialDesignIfc = LatinHyperCubeDesign(), incumbentRule: IncumbentRuleIfc = BestPosteriorMeanIncumbent(), initialDesignSize: Int = defaultInitialDesignSize, maximumIterations: Int = boDefaultMaxIterations, replicationsPerEvaluation: Int = defaultReplicationsPerEvaluation, name: String? = null)

Constructs a Bayesian optimization solver using a fixed number of replications per evaluation.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The acquisition function. Cannot be changed while the solver is running.

Link copied to clipboard

The acquisition optimizer. Cannot be changed while the solver is running.

Link copied to clipboard

Structured, ordered snapshot of the solver's configuration — the same fields the toString implementations expose, in a form that downstream consumers can iterate (reporting, machine-readable summary artifacts, "compare two runs" tooling).

Link copied to clipboard

The current incumbent value according to the configured incumbentRule.

Link copied to clipboard

The surrogate hyperparameter fitter. Cannot be changed while the solver is running.

Link copied to clipboard

The incumbent rule. Cannot be changed while the solver is running.

Link copied to clipboard

The initial design strategy. Cannot be changed while the solver is running.

Link copied to clipboard

The number of initial design points. Must be >= 2 (recommended >= problem dimension + 1).

Link copied to clipboard

An optional cap on the surrogate's training-set (archive) size, bounding the GP's O(n^3) cost; when set, the best solutions are retained. Null (the default) means no cap. Must be

Link copied to clipboard

A read-only view of the observed solutions (the surrogate's training set).

Link copied to clipboard

How often (in iterations) the surrogate hyperparameters are refit. Must be >= 1.

Link copied to clipboard

Used to detect no-improvement convergence.

Link copied to clipboard

The surrogate model. Cannot be changed while the solver is running.

Functions

Link copied to clipboard
protected open override fun extractSolverSpecificState(): Map<String, Double>

A hook for subclasses to inject their specific internal state metrics into the snapshot without having to override the entire makeSolverStateSnapshot method.

Link copied to clipboard
protected open override fun initializeIterations()

Subclasses may implement this function to prepare the solver before running the first iteration. Generally, it is sufficient to just implement the startingPoint() function.

Link copied to clipboard
protected open override fun isStoppingCriteriaSatisfied(): Boolean

Subclasses should implement this function to determine if the solver should continue running iterations. This will likely include some implementation of stopping criteria. This function should implement stopping criteria based on the quality of the solution. The number of iterations, compared to the maximum number of iterations, is automatically checked after each step in the iterative process. Unless overridden, this function returns false by default, which indicates that the solution quality criteria have not been satisfied. This will cause the solver to iterate through all iterations of the solution process up to the maximum number of iterations. Alternatively, the user can specify an instance of the SolutionQualityEvaluatorIfc interface to determine if the solution quality has been reached.

Link copied to clipboard
protected open override fun mainIteration()

This function should contain the logic that iteratively executes until the maximum number of iterations is reached or until the stopping criteria is met. The base implementation calls nextPoint() to determine the next point to evaluate, requests an evaluation of the point, and then updates the current solution if the resulting solution is better than the current solution. Generally, implementing startingPoint() and nextPoint() should be adequate. The property iterationCounter represents the current iteration within the mainIteration() function. That is, the value of iterationCounter is incremented prior to the execution of the mainIteration() function.

Link copied to clipboard
open override fun toString(): String