superstats.transition.stochastic.kernel.rbf#
Radial basis function covariance kernels.
Functions
|
Squared pairwise distances for num_steps evenly spaced points on [0, 1]. |
|
Batched RBF kernel construction. |
Classes
|
RBF kernel. |
- class superstats.transition.stochastic.kernel.rbf.RBFKernel(name=None)[source]#
Bases:
KernelRBF kernel. Requires hyperparameters length_scale, amplitude.
- Parameters:
- name
str,optional Prefix for this kernel’s hyperparameter names. Leave unset for a single RBF kernel, or when combining with a kernel of a different type. Required when combining two RBF kernels, e.g. RBFKernel(name=”short”) + RBFKernel(name=”long”).
- name
- Parameters:
name (str | None)
- build(num_steps, **hyperparams)[source]#
Construct the (batch_size, num_steps, num_steps) kernel matrix.
- Parameters:
- num_steps
int - **hyperparams
np.ndarray Must contain every name in self.hyperparam_names, each of shape (batch_size,). Extra keys (from sibling kernels in a composite) are ignored.
- num_steps
- Returns:
- kernel_mat
np.ndarrayofshape(batch_size,num_steps,num_steps)
- kernel_mat
- Parameters:
- Return type:
- superstats.transition.stochastic.kernel.rbf.build_sq_dist_mat(num_steps)[source]#
Squared pairwise distances for num_steps evenly spaced points on [0, 1].
- Parameters:
- num_steps
int Number of points in the 1D grid.
- num_steps
- Returns:
- sq_dist
np.ndarrayofshape(num_steps,num_steps) Squared distance between point i and point j at [i, j].
- sq_dist
- Parameters:
num_steps (int)
- Return type:
- superstats.transition.stochastic.kernel.rbf.get_rbf_kernel(num_steps, length_scale, amplitude)[source]#
Batched RBF kernel construction.
- Parameters:
- num_steps
int Number of points in the 1D grid.
- length_scale
np.ndarrayofshape(batch_size,) Kernel width per trajectory; larger values mean smoother, slower-varying draws.
- amplitude
np.ndarrayofshape(batch_size,) Kernel variance / overall scale per trajectory.
- num_steps
- Returns:
- kernel_mat
np.ndarrayofshape(batch_size,num_steps,num_steps)
- kernel_mat
- Parameters:
- Return type: