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, **kwargs)[source]#
A single-task
GPOptimizerfor observations bounded in [0, 1].Observations are modeled in logit (log-odds) space (the GP sees
logit(y)), and posterior predictions are mapped back with the logistic/sigmoid viaevaluate_posterior(), which guarantees predictions and credible intervals inside (0, 1). Becauselogit(0)/logit(1)are infinite, 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; 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.
Notes
All other constructor arguments are identical to
GPOptimizer. The inheritedposterior_mean()/posterior_covariance()operate in logit-space; useevaluate_posterior()for the original (0, 1) scale. The acquisition-function note forLogGPOptimizerapplies here too (passtarget probabilitybounds in logit-space).