InducingPointKernel<T>
Models & Types · AiDotNet.Kernels
Inducing Point Kernel for sparse Gaussian Process approximations.
Implements: IKernelFunction<T>
For Beginners
The Inducing Point Kernel is fundamental to making GPs scale to large datasets. Instead of working with all N training points (O(N³) complexity), we use a smaller set of M “inducing points” (O(NM² + M³) complexity, where M << N).
The key idea: Instead of modeling the full function f, we model:
- The function values at M inducing points: u = f(Z)
- The conditional distribution: f(x) | u
The approximation makes f(x) conditionally independent given the inducing values u. The closer the inducing points are to your data, the better the approximation.
This kernel computes the “Q_ff” approximation: Q(x, x’) = k(x, Z) × k(Z, Z)⁻¹ × k(Z, x’)
Where:
- Z are the inducing point locations (M × d)
- k(x, Z) is the cross-covariance (1 × M)
- k(Z, Z) is the inducing point covariance (M × M)
This is the Nyström approximation of the full kernel matrix.
How It Works
Usage patterns:
- Use with SparseVariationalGaussianProcess for scalable GP regression
- Inducing points can be learned via optimization
- Good initialization: subset of training data or k-means centroids
Constructors
| Constructor | Summary |
|---|---|
InducingPointKernel(IKernelFunction<T> baseKernel, Matrix<T> inducingPoints, double jitter) |
Initializes an Inducing Point Kernel. |
Properties
| Property | Summary |
|---|---|
IKernelFunction<T> BaseKernel { get; } |
Gets the base kernel. |
int NumInducingPoints { get; } |
Gets the number of inducing points. |
Methods
| Method | Summary |
|---|---|
Matrix<T> ComputeCrossCovariance(Matrix<T> X) |
Computes the cross-covariance between test points and inducing points. |
Matrix<T> GetCholeskyFactor() |
Gets the Cholesky factor of k(Z, Z). |
Matrix<T> GetInducingPointCovariance() |
Gets the inducing point covariance matrix k(Z, Z). |
Matrix<T> GetInducingPoints() |
Gets a copy of the inducing points. |
T Calculate(Vector<T> x1, Vector<T> x2) |
Calculates the approximate kernel value (Nyström approximation). |
T EstimateApproximationError(Matrix<T> X) |
Estimates the approximation quality at a set of test points. |
void PrecomputeMatrices() |
Precomputes the inducing point matrices for efficiency. |
void UpdateInducingPoints(Matrix<T> newInducingPoints) |
Updates the inducing point locations. |