View source on GitHub |
Student-T Process expected improvement acquisition function.
Inherits From: AcquisitionFunction
tfp.experimental.bayesopt.acquisition.StudentTProcessExpectedImprovement(
predictive_distribution, observations, seed=None, exploration=0.01
)
Computes the analytic sequential expected improvement for a Student-T process model.
Requires that predictive_distribution
has a mean
, stddev
method.
Examples
Build and evaluate a Student T Process Expected 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 5-dimensional index points and associated observations.
index_points = np.random.uniform(size=[10, 5])
observations = np.random.uniform(size=[10])
# Build a Student T Process regression model over the function values at
# `predictive_index_points` conditioned on observations.
predictive_index_points = np.random.uniform(size=[8, 5])
dist = tfd.StudentTProcessRegressionModel(
kernel=tfpk.MaternFiveHalves(),
df=5.,
observation_index_points=index_points,
observations=observations,
predictive_index_points=predictive_index_points)
# Define a Student T Process Expected Improvement acquisition function.
stp_ei = tfp_acq.StudentTProcessExpectedImprovement(
predictive_distribution=dist,
observations=observations,
exploration=0.02)
# Evaluate the acquisition function at `predictive_index_points`.
acq_fn_vals = stp_ei() # Has shape [8].
# Evaluate the acquisition function at a new set of predictive index points.
new_pred_index_points = np.random.uniform(size=[6, 5])
acq_fn_vals = stp_ei(pred_index_points) # Has shape [6].
Methods
__call__
__call__(
**kwargs
)
Computes the Student-T process expected improvement.
Args | |
---|---|
**kwargs
|
Keyword args passed on to the mean and stddev methods of
predictive_distribution .
|
Returns | |
---|---|
Expected improvements at index points implied by predictive_distribution
(or overridden in **kwargs ).
|