-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pathwise Sampling (Take 2) #112
Conversation
# Computes the optimal closed form solution for the variational posterior | ||
# q(u) (e.g. # https://krasserm.github.io/2020/12/12/gaussian-processes-sparse/ | ||
# equations (11) & (12)). Assumes a ZeroMean function. | ||
function optimal_variational_posterior(fu, fx, y) | ||
fu.f.mean isa AbstractGPs.ZeroMean || | ||
error("The exact posterior requires a GP with ZeroMean.") | ||
σ² = fx.Σy[1] | ||
Kuf = cov(fu, fx) | ||
Kuu = Symmetric(cov(fu)) | ||
Σ = (Symmetric(cov(fu) + (1 / σ²) * Kuf * Kuf')) | ||
m = ((1 / σ²) * Kuu * (Σ \ Kuf)) * y | ||
S = Symmetric(Kuu * (Σ \ Kuu)) | ||
return MvNormal(m, S) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this to src/sparse_variational.jl
and improved it a bit
Docs build will fail because of #105 EDIT: I think I will just remove the example from this PR and add it in a separate one once this is merged and tagged |
Codecov Report
@@ Coverage Diff @@
## master #112 +/- ##
==========================================
- Coverage 95.78% 95.42% -0.37%
==========================================
Files 4 5 +1
Lines 285 328 +43
==========================================
+ Hits 273 313 +40
- Misses 12 15 +3
Continue to review full report at Codecov.
|
Supersedes #65, Closes #7
Implements pathwise sampling of functions from sparse GP posteriors from [1]
[1] https://arxiv.org/abs/2002.09309
TODO: