Transformed Optimizers#
Single-task optimizers that fit a Gaussian process to observations after a fixed
output transform (link function), and use
:py:meth:gpcam.GPOptimizer.evaluate_posterior to push the latent Gaussian
posterior back through the inverse link to the original observation space.
Use :py:class:gpcam.LogGPOptimizer for strictly positive observations in
(0, inf) — predictions and credible intervals are guaranteed positive, and
the original-scale mean/std are available in closed form (lognormal).
Use :py:class:gpcam.LogitGPOptimizer for observations bounded in [0, 1] —
predictions and credible intervals are guaranteed inside (0, 1); the
original-scale mean/std are estimated by Monte Carlo (logistic-normal has no
closed form). Observations are clipped to [eps, 1 - eps] because
logit(0)/logit(1) are infinite.
The inherited :py:meth:posterior_mean / :py:meth:posterior_covariance
operate in the GP’s modeling space (log / logit); use
:py:meth:evaluate_posterior to obtain a posterior on the original scale.
LogGPOptimizer#
- class gpcam.gp_optimizer.LogGPOptimizer(x_data=None, y_data=None, init_hyperparameters=None, noise_variances=None, compute_device='cpu', kernel_function=None, kernel_function_grad=None, noise_function=None, noise_function_grad=None, prior_mean_function=None, prior_mean_function_grad=None, gp2Scale=False, dask_client=None, gp2Scale_batch_size=10000, linalg_mode=None, ram_economy=False, cost_function=None, logging=False, args=None)[source]#
A single-task
GPOptimizerfor strictly positive observations in (0, inf).Observations are modeled in log-space (the GP sees
log(y)), and posterior predictions are mapped back to the original scale withexpviaevaluate_posterior(), which guarantees strictly positive predictions and credible intervals.expof a Gaussian is lognormal, so the original-scale mean and standard deviation are available in closed form.All constructor arguments are identical to
GPOptimizer. Note that the inheritedposterior_mean()/posterior_covariance()operate in log-space; useevaluate_posterior()for the original (positive) scale.Acquisition functions:
ask()optimizes the GP in log-space. Becauselogis monotone increasing, ranking acquisitions (variance,ucb,lcb,maximum,minimum) still identify the same locations as on the original scale. Fortarget probability, pass bounds already in log-space (np.log(a),np.log(b)).
LogitGPOptimizer#
- class gpcam.gp_optimizer.LogitGPOptimizer(x_data=None, y_data=None, eps=1e-06, n_samples=10000, range=(0.0, 1.0), **kwargs)[source]#
A single-task
GPOptimizerfor observations bounded in a closed interval[lower, upper](default[0, 1]).Observations are linearly rescaled to
[0, 1]and modeled in logit (log-odds) space (the GP seeslogit((y - lower) / (upper - lower))). Posterior predictions are mapped back to[lower, upper]via the inverse (affine ∘ sigmoid) throughevaluate_posterior(), which guarantees predictions and credible intervals stay inside(lower, upper). Becauselogit(0)/logit(1)are infinite, normalized observations are clipped to[eps, 1 - eps](a warning is emitted when clipping occurs). The logistic-normal distribution has no closed-form moments, so the original-scale mean and standard deviation are estimated by Monte-Carlo.- Parameters:
eps (float, optional) – Clipping margin for the open interval; normalized observations are clipped to
[eps, 1 - eps]before the logit transform. The default is 1e-6.n_samples (int, optional) – Number of Monte-Carlo samples used to estimate the original-scale mean/std in
evaluate_posterior(). The default is 10000.range (tuple of float, optional) –
(lower, upper)bounds of the observation domain. Observations are linearly rescaled to[0, 1]before the logit transform, and posterior predictions are mapped back to[lower, upper]. The default is(0.0, 1.0).
Notes
All other constructor arguments are identical to
GPOptimizer. The inheritedposterior_mean()/posterior_covariance()operate in logit-space (on the rescaled[0, 1]data); useevaluate_posterior()for the original[lower, upper]scale. The acquisition-function note forLogGPOptimizerapplies here too (passtarget probabilitybounds in logit-space, where they refer to the rescaled[0, 1]data).