Skip to content

Commit 6a5877f

Browse files
Improve package overview (#116)
* do not reexport AbstractGPs * add structure to README * update docs/src/index.md * add missing method implementations for SparseVariationalApproximation * Update src/SparseVariationalApproximationModule.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * patch bump Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 2627feb commit 6a5877f

File tree

5 files changed

+43
-4
lines changed

5 files changed

+43
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ApproximateGPs"
22
uuid = "298c2ebc-0411-48ad-af38-99e88101b606"
33
authors = ["JuliaGaussianProcesses Team"]
4-
version = "0.3.1"
4+
version = "0.3.2"
55

66
[deps]
77
AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918"

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,30 @@
55
[![Codecov](https://codecov.io/gh/JuliaGaussianProcesses/ApproximateGPs.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaGaussianProcesses/ApproximateGPs.jl)
66
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
77
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
8+
9+
## Aim of this package
10+
11+
Provide various algorithms for approximate inference in latent Gaussian process models, currently focussing on non-conjugate (non-Gaussian) likelihoods and sparse approximations.
12+
13+
## Structure
14+
15+
Each approximation lives in its own submodule (`<Approximation>Module`), though
16+
in general using the exported API is sufficient.
17+
18+
The main API is:
19+
20+
* `posterior(approximation, lfx::LatentFiniteGP, ys)` to obtain the posterior
21+
approximation to `lfx` conditioned on the observations `ys`.
22+
23+
* `approx_lml(approximation, lfx::LatentFiniteGP, ys)` which returns the
24+
marginal likelihood approximation that can be used for hyperparameter
25+
optimisation.
26+
27+
Currently implemented approximations:
28+
29+
* `LaplaceApproximation`
30+
31+
* `SparseVariationalApproximation`
32+
33+
NOTE: requires optimisation of the variational distribution even for fixed
34+
hyperparameters.

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ApproximateGPs.jl
22

3-
**ApproximateGPs.jl** is a package that provides sparse variational Gaussian process
4-
approximations, built on top of
3+
**ApproximateGPs.jl** is a package that provides some approximate inference
4+
algorithms for Gaussian process models, built on top of
55
[AbstractGPs.jl](https://github.com/JuliaGaussianProcesses/AbstractGPs.jl).

src/ApproximateGPs.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ module ApproximateGPs
22

33
using Reexport
44

5-
@reexport using AbstractGPs
65
@reexport using GPLikelihoods
76

87
include("API.jl")

src/SparseVariationalApproximationModule.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ function AbstractGPs.posterior(
196196
return posterior(sva)
197197
end
198198

199+
function AbstractGPs.posterior(
200+
sva::SparseVariationalApproximation, lfx::LatentFiniteGP, ::Any
201+
)
202+
@assert sva.fz.f === lfx.fx.f
203+
return posterior(sva)
204+
end
205+
199206
#
200207
# Various methods implementing the Internal AbstractGPs API.
201208
# See AbstractGPs.jl API docs for more info.
@@ -269,6 +276,12 @@ inducing_points(f::ApproxPosteriorGP{<:SparseVariationalApproximation}) = f.appr
269276
# elbo
270277
#
271278

279+
function API.approx_lml(
280+
sva::SparseVariationalApproximation, l_fx::Union{FiniteGP,LatentFiniteGP}, ys; kwargs...
281+
)
282+
return elbo(sva, l_fx, ys; kwargs...)
283+
end
284+
272285
"""
273286
elbo(
274287
sva::SparseVariationalApproximation,

0 commit comments

Comments
 (0)