emukit.core.interfaces package

Submodules

class emukit.core.interfaces.models.IModel

Bases: object

predict(X)

Predict mean and variance values for given points

Parameters:

X (ndarray) – array of shape (n_points x n_inputs) of points to run prediction for

Return type:

Tuple[ndarray, ndarray]

Returns:

Tuple of mean and variance which are 2d arrays of shape (n_points x n_outputs)

set_data(X, Y)

Sets training data in model

Parameters:
  • X (ndarray) – new points

  • Y (ndarray) – function values at new points X

Return type:

None

optimize()

Optimize hyper-parameters of model

Return type:

None

property X
property Y
class emukit.core.interfaces.models.IDifferentiable

Bases: object

get_prediction_gradients(X)

Computes and returns model gradients of mean and variance at given points

Parameters:

X (ndarray) – points to compute gradients at

Return type:

Tuple

Returns:

Tuple of gradients of mean and variance.

class emukit.core.interfaces.models.IJointlyDifferentiable

Bases: object

predict_with_full_covariance(X)
Parameters:

X (ndarray) – (n_points x n_dimensions) array containing locations at which to get predictions

Return type:

Tuple[ndarray, ndarray]

Returns:

(mean, variance) Arrays of size n_points x 1 and n_points x n_points of the predictive mean and variance at each input location

get_joint_prediction_gradients(X)

Computes and returns model gradients of mean and full covariance matrix at given points

Parameters:

X (ndarray) – points to compute gradients at, nd array of shape (q, d)

Return type:

Tuple[ndarray, ndarray]

Returns:

Tuple with first item being gradient of the mean of shape (q) at X with respect to X (return shape is (q, q, d)). The second item is the gradient of the full covariance matrix of shape (q, q) at X with respect to X (return shape is (q, q, q, d)).

class emukit.core.interfaces.models.IPriorHyperparameters

Bases: object

generate_hyperparameters_samples(n_samples, n_burnin, subsample_interval, step_size, leapfrog_steps)

Generates the samples from the hyper-parameters of the model, and returns them.

Parameters:
  • n_samples (int) – Number of hyper-parameter samples

  • n_burnin (int) – Number of initial samples not used.

  • subsample_interval (int) – Interval of subsampling from HMC samples.

  • step_size (float) – Size of the gradient steps in the HMC sampler.

  • leapfrog_steps (int) – Number of gradient steps before each Metropolis Hasting step.

Return type:

ndarray

fix_model_hyperparameters(sample_hyperparameters)

Fixes the model hyper-parameters to certain values (which can be taken from samples).

Parameters:

sample_hyperparameters (ndarray) – np.ndarray whose rows contain each hyper-parameters set.

Return type:

None

class emukit.core.interfaces.models.IModelWithNoise

Bases: object

predict_noiseless(X)

For given points X, predict mean and variance of the output without observation noise.

Parameters:

X (ndarray) – array of shape (n_points x n_inputs) of points to run prediction for

Return type:

Tuple[ndarray, ndarray]

Returns:

Tuple of mean and variance which are 2d arrays of shape (n_points x n_outputs)

Module contents