# revrand.basis_functions.RandomLaplace¶

class revrand.basis_functions.RandomLaplace(nbases, Xdim, lenscale=Parameter(value=1.0, bounds=Positive(upper=None), shape=()), regularizer=None, random_state=None)

Random Laplace Basis – Approximates a Laplace kernel function.

This will make a linear regression model approximate a GP with an (optionally ARD) Laplace covariance function.

$\phi(\mathbf{x})^\top \phi(\mathbf{x}') \approx \exp\left( -\frac{\| \mathbf{x} - \mathbf{x}' \|}{l} \right)$

with a length scale, $$l$$ (a vector in $$\mathbb{R}^d$$ for ARD).

Parameters: nbases (int) – how many unique random bases to create (twice this number will be actually created, i.e. real and imaginary components for each base) Xdim (int) – the dimension (d) of the observations (or the dimension of the slices if using apply_ind). lenscale (Parameter, optional) – A scalar or vector of shape (1,) or (d,) Parameter to bound and initialise the length scales for optimization. If this is shape (d,), ARD length scales will be expected, otherwise an isotropic lenscale is learned. regularizer (None, Parameter, optional) – The (initial) value of the regularizer/prior variance to apply to the regression weights of this basis function. The Parameter object must have a scalar value. If it is not set, it will take on a default value of Parameter(gamma(1.), Positive()). random_state (None, int or RandomState, optional) – random seed
__init__(nbases, Xdim, lenscale=Parameter(value=1.0, bounds=Positive(upper=None), shape=()), regularizer=None, random_state=None)

See this class’s docstring.

Methods

 __init__(nbases, Xdim[, lenscale, bounds, ...]) See this class’s docstring. get_dim(X) Get the output dimensionality of this basis. grad(X[, lenscale]) Get the gradients of this basis w.r.t.the length scales. params_values() Get a list of the Parameter values if they have a value. regularizer_diagonal(X[, regularizer]) Get the diagonal of the prior variance on the weights (regularizer). transform(X[, lenscale]) Apply the random basis to X.

Attributes

 params Get this basis’ Parameter types. regularizer Get the Parameter value of this basis’ regularizer.