boax.core.models module#

Implements functionalities to construct surrogate models.

boax.core.models#

Model Types#

class boax.core.models.Model(*args, **kwargs)#

A callable type for surrogate models.

A model takes a set of b0 x … x bn x n x d-dim index points as input and returns a posterior prediction of type T.

Models#

Gaussian Process Models#

exact(mean_fn, kernel_fn, likelihood_fn[, ...])

The exact gaussian process model.

boax.core.models.transformations#

Transformations#

Transformed Models#

transformed(model, *[, ...])

Constructs an model with input_transformation_fn applied to its inputs and the output_transformation_fn applied to its outcomes.

joined(*models)

Constructs a joined model.

boax.core.models.means#

Mean Types#

class boax.core.models.means.Mean(*args, **kwargs)#

A callable type for mean functions.

A mean functions takes a b0 x … x bn x n x d-dim array as input and returns an b0 x … x bn x n-dim array of mean function values.

Means#

Common Means#

zero()

The zero mean function.

constant(c)

The constant mean function.

linear(scale, bias)

The linear mean function.

boax.core.models.kernels#

Kernel Types#

class boax.core.models.kernels.Kernel(*args, **kwargs)#

A callable type for kernels.

A kernel takes two n x d-dim arrays as input and returns an n x n-dim matrix of kernel function values.

Kernels#

Radial Basis Kernels#

rbf(length_scale)

The Radial basis function (RBF) kernel.

Matérn Kernels#

matern_one_half(length_scale)

The Matern kernel with parameter 1/2.

matern_three_halves(length_scale)

The Matern kernel with parameter 3/2.

matern_five_halves(length_scale)

The Matern kernel with parameter 5/2.

boax.core.models.kernels.transformations#

Transformations#

Transformed Kernels#

scaled(inner, amplitude)

Scales a given kernel.

additive(*kernels)

Constructs an additive kernel which sums over a sequence of kernels.

product(*kernels)

Constructs a product kernel which multiplies over a sequence of kernels.

boax.core.models.likelihoods#

Likelihood Types#

class boax.core.models.likelihoods.Likelihood(*args, **kwargs)#

A callable type for likelihoods.

Likelihoods#

Common Likelihoods#

beta(scale)

The beta likelihood function.

gaussian(noise)

The gaussian likelihood function.

boax.core.objectives#

Objective Types#

class boax.core.objectives.Objective(*args, **kwargs)#

A callable type for objectives.

An objective function takes a posterior prediction of type T and an array of targets as input and returns an objective value.

Objectives#

Common Objectives#

negative_log_likelihood(logpdf_fn)

The negative log likelihood objective function.

boax.core.objectives.transformations#

Transformations#

Transformed Objectives#

penalized(objective, *terms)

Adds penalty terms to an objective function.