Skip to content

Mean Functions

AbstractMeanFunction

AbstractMeanFunction()

Bases: Module

Mean function that is used to parameterise the Gaussian process.

__call__ abstractmethod

__call__(x: Num[Array, 'N D']) -> Float[Array, 'N O']

Evaluate the mean function at the given points. This method is required for all subclasses.

Parameters:

  • x (Float[Array, ' D']) –

    The point at which to evaluate the mean function.

Returns:

  • Float[Array, 'N O'] –

    Float[Array, "1]: The evaluated mean function.

__add__

__add__(
    other: Union[AbstractMeanFunction, Float[Array, " O"]],
) -> AbstractMeanFunction

Add two mean functions.

Parameters:

Returns:

__mul__

__mul__(
    other: Union[AbstractMeanFunction, Float[Array, " O"]],
) -> AbstractMeanFunction

Multiply two mean functions.

Parameters:

Returns:

Constant

Constant(
    constant: Union[
        ScalarFloat, Float[Array, " O"], Parameter
    ] = 0.0,
)

Bases: AbstractMeanFunction

Constant mean function.

A constant mean function. This function returns a repeated scalar value for all inputs. The scalar value itself can be treated as a model hyperparameter and learned during training but defaults to 1.0.

__call__

__call__(x: Num[Array, 'N D']) -> Float[Array, 'N O']

Evaluate the mean function at the given points.

Parameters:

  • x (Float[Array, ' D']) –

    The point at which to evaluate the mean function.

Returns:

  • Float[Array, 'N O'] –

    Float[Array, "1"]: The evaluated mean function.

__add__

__add__(
    other: Union[AbstractMeanFunction, Float[Array, " O"]],
) -> AbstractMeanFunction

Add two mean functions.

Parameters:

Returns:

__mul__

__mul__(
    other: Union[AbstractMeanFunction, Float[Array, " O"]],
) -> AbstractMeanFunction

Multiply two mean functions.

Parameters:

Returns:

Zero

Zero()

Bases: Constant

Zero mean function.

The zero mean function. This function returns a zero scalar value for all inputs. Unlike the Constant mean function, the constant scalar zero is fixed, and cannot be treated as a model hyperparameter and learned during training.

__call__

__call__(x: Num[Array, 'N D']) -> Float[Array, 'N O']

Evaluate the mean function at the given points.

Parameters:

  • x (Float[Array, ' D']) –

    The point at which to evaluate the mean function.

Returns:

  • Float[Array, 'N O'] –

    Float[Array, "1"]: The evaluated mean function.

__add__

__add__(
    other: Union[AbstractMeanFunction, Float[Array, " O"]],
) -> AbstractMeanFunction

Add two mean functions.

Parameters:

Returns:

__mul__

__mul__(
    other: Union[AbstractMeanFunction, Float[Array, " O"]],
) -> AbstractMeanFunction

Multiply two mean functions.

Parameters:

Returns:

CombinationMeanFunction

CombinationMeanFunction(
    means: list[AbstractMeanFunction],
    operator: Callable,
    **kwargs,
)

Bases: AbstractMeanFunction

A base class for products or sums of AbstractMeanFunctions.

__call__

__call__(x: Num[Array, 'N D']) -> Float[Array, 'N O']

Evaluate combination kernel on a pair of inputs.

Parameters:

  • x (Float[Array, ' D']) –

    The point at which to evaluate the mean function.

Returns:

  • Float[Array, 'N O'] –

    Float[Array, " Q"]: The evaluated mean function.

__add__

__add__(
    other: Union[AbstractMeanFunction, Float[Array, " O"]],
) -> AbstractMeanFunction

Add two mean functions.

Parameters:

Returns:

__mul__

__mul__(
    other: Union[AbstractMeanFunction, Float[Array, " O"]],
) -> AbstractMeanFunction

Multiply two mean functions.

Parameters:

Returns: