revrand.basis_functions.RadialBasis¶
-
class
revrand.basis_functions.
RadialBasis
(centres, lenscale=Parameter(value=1.0, bounds=Positive(upper=None), shape=()), regularizer=None)¶ Radial basis class.
\[\phi(\mathbf{X}) = \exp \left( -\frac{\|\mathbf{X} - \mathbf{C}\|^2} {2 l^2} \right)\]Where \(\mathbf{C}\) are radial basis centres, and \(l\) is a length scale.
Parameters: - centres (ndarray) – array of shape (Dxd) where D is the number of centres for the radial bases, and d is the dimensionality of X.
- 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())
.
Note
This will have relevance vector machine-like behaviour with uncertainty.
-
__init__
(centres, lenscale=Parameter(value=1.0, bounds=Positive(upper=None), shape=()), regularizer=None)¶ See this class’s docstring.
Methods
__init__
(centres[, lenscale, bounds, shape, ...])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 scale. 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 RBF to X. Attributes
params
Get this basis’ Parameter types. regularizer
Get the Parameter
value of this basis’ regularizer.