View source on GitHub |
Parallel probability of improvement acquisition function.
Inherits From: AcquisitionFunction
tfp.experimental.bayesopt.acquisition.ParallelProbabilityOfImprovement(
predictive_distribution,
observations,
seed=None,
num_samples=100,
transform_fn=None
)
Computes the q-PI from a multivariate observation model. This is also known as batch probability of improvement.
Requires that predictive_distribution
has a sample
method.
Examples
Build and evaluate a Parallel Probability of Improvement acquisition function.
import numpy as np
import tensorflow_probability as tfp
tfd = tfp.distributions
tfpk = tfp.math.psd_kernels
tfp_acq = tfp.experimental.bayesopt.acquisition
# Sample 10 20-dimensional index points and associated observations.
index_points = np.random.uniform(size=[10, 20])
observations = np.random.uniform(size=[10])
# Build a Student T Process regression model conditioned on observed data.
dist = tfd.StudentTProcessRegressionModel(
kernel=tfpk.ExponentiatedQuadratic(),
df=5.,
observation_index_points=index_points,
observations=observations)
# Define a Parallel Probability of Improvement acquisition function.
stp_pei = tfp_acq.ParallelProbabilityOfImprovement(
predictive_distribution=dist,
observations=observations,
num_samples=10_000)
# Evaluate the acquisition function at a new set of index points.
pred_index_points = np.random.uniform(size=[6, 20])
acq_fn_vals = stp_pei(pred_index_points) # Has shape [6].
Methods
__call__
__call__(
**kwargs
)
Computes the Parallel Probability of Improvement.
Args | |
---|---|
**kwargs
|
Keyword args passed on to the sample method of
predictive_distribution .
|
Returns | |
---|---|
Parallel Probability of improvement at index points implied by
predictive_distribution (or overridden in **kwargs ).
|