https://github.com/juliagaussianprocesses/inducingpoints.jl
Package for different inducing points selection methods
https://github.com/juliagaussianprocesses/inducingpoints.jl
Last synced: 8 months ago
JSON representation
Package for different inducing points selection methods
- Host: GitHub
- URL: https://github.com/juliagaussianprocesses/inducingpoints.jl
- Owner: JuliaGaussianProcesses
- License: mit
- Created: 2020-07-25T22:01:24.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-03T15:09:49.000Z (about 3 years ago)
- Last Synced: 2025-01-20T18:57:29.960Z (over 1 year ago)
- Language: Julia
- Size: 523 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# InducingPoints
[](https://JuliaGaussianProcesses.github.io/InducingPoints.jl/stable)
[](https://JuliaGaussianProcesses.github.io/InducingPoints.jl/dev)

[](https://coveralls.io/github/JuliaGaussianProcesses/InducingPoints.jl?branch=master)
A package for selecting inducing points for sparse GPs
This package provide a collection of inducing point location selection algorithms, both offline and online.
## Offline algorithms
Offline algorithms are meant to be run once over the data before training begins.
Here is an example where we use the k-means algorithm
```julia
using InducingPoints
X = [rand(5) for _ in 1:100]
alg = KMeansAlg(10) # Create the kmeans algorithm
Z = inducingpoints(alg, X) # Returns a vector of vector of size 10
```
will return 10 inducing points selected as clusters by the k-means algorithm
Note that it is possible to pass data as a matrix as well following the convention of [KernelFunctions.jl](https://juliagaussianprocesses.github.io/KernelFunctions.jl/dev/userguide/#Creating-a-Kernel-Matrix)
```julia
X = rand(5 , 1000)
alg = KMeansAlg(10, Euclidean()) # We can also use different metrics
Z = inducingpoints(alg, X) # This still returns a vector of vector of size 10
```
## Online algorithms
Online algorithms needs two API, a first one to create the initial vector of inducing points and another one to update it with new data.
For example following [this work](https://drive.google.com/file/d/1IPTUBfY_b2WElTWBIVU4lrbHcXnbTWdB/view)
```julia
alg = OIPS(200) # We expect 200 inducing points
kernel = SqExponential()
X = [rand(5) for _ in 1:100] # We have some initial data
Z = inducingpoints(alg, X; kernel=kernel) # We create an initial vector
X_new = [rand(5) for _ in 1:50] # We get some new data
updateZ!(Z, alg, X_new; kernel=kernel) # Points will be acordingly added (or removed!)
```
Note that `Z` is directly changed in place.
## Notes
Make sure to check each algorithm docs independently, they will give you more details on what arguments they need and what they do!