gpflow.mean_functions#

Throughout GPflow, by default, latent functions being modelled with Gaussian processes are assumed to have zero mean, f ~ GP(0, k(x,x’)).

In some cases we may wish to model only the deviation from a fixed function with a Gaussian process. For flexibility this fixed function could be both input dependent and parameterised function, μ(x; θ), with some unknown parameters θ, resulting in f ~ GP(μ(x;θ), k(x,x’)).

The GPflow MeanFunction class allows this to be done whilst additionally learning parameters of the parametric function.

Classes#

gpflow.mean_functions.Additive#

class gpflow.mean_functions.Additive(first_part, second_part)[source]#

Bases: gpflow.mean_functions.MeanFunction

Parameters

gpflow.mean_functions.Constant#

class gpflow.mean_functions.Constant(c=None)[source]#

Bases: gpflow.mean_functions.MeanFunction

Parameters

c (Union[ndarray[Any, Any], Tensor, Variable, Parameter, None]) –

gpflow.mean_functions.Identity#

class gpflow.mean_functions.Identity(input_dim=None)[source]#

Bases: gpflow.mean_functions.Linear

y_i = x_i

Parameters

input_dim (Optional[int]) –

gpflow.mean_functions.Linear#

class gpflow.mean_functions.Linear(A=None, b=None)[source]#

Bases: gpflow.mean_functions.MeanFunction

y_i = A x_i + b

Parameters
  • A (Union[ndarray[Any, Any], Tensor, Variable, Parameter, None]) –

  • b (Union[ndarray[Any, Any], Tensor, Variable, Parameter, None]) –

gpflow.mean_functions.MeanFunction#

class gpflow.mean_functions.MeanFunction(name=None)[source]#

Bases: gpflow.base.Module

The base mean function class. To implement a mean function, write the __call__ method. This takes a tensor X and returns a tensor m(X). In accordance with the GPflow standard, each row of X represents one datum, and each row of Y is computed independently for each row of X.

MeanFunction classes can have parameters, see the Linear class for an example.

gpflow.mean_functions.Product#

class gpflow.mean_functions.Product(first_part, second_part)[source]#

Bases: gpflow.mean_functions.MeanFunction

Parameters

gpflow.mean_functions.SwitchedMeanFunction#

class gpflow.mean_functions.SwitchedMeanFunction(meanfunction_list)[source]#

Bases: gpflow.mean_functions.MeanFunction

This class enables to use different (independent) mean_functions respective to the data ‘label’. We assume the ‘label’ is stored in the extra column of X.

Parameters

meanfunction_list (Collection[MeanFunction]) –

gpflow.mean_functions.Zero#

class gpflow.mean_functions.Zero(output_dim=1)[source]#

Bases: gpflow.mean_functions.Constant

Parameters

output_dim (int) –