Skip to content
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

Closed
wants to merge 17 commits into from
Closed

Conversation

rossviljoen
Copy link
Collaborator

@rossviljoen rossviljoen commented Feb 27, 2022

Supersedes #65, Closes #7

Implements pathwise sampling of functions from sparse GP posteriors from [1]

[1] https://arxiv.org/abs/2002.09309


TODO:

  • Remove example before merging and move it to a new PR

@rossviljoen rossviljoen mentioned this pull request Feb 27, 2022
3 tasks
src/pathwise_sampling.jl Outdated Show resolved Hide resolved
Comment on lines -4 to -17
# 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
Copy link
Collaborator Author

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

@rossviljoen
Copy link
Collaborator Author

rossviljoen commented Feb 27, 2022

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
Copy link

codecov bot commented Feb 27, 2022

Codecov Report

Merging #112 (41eb95e) into master (e8513ad) will decrease coverage by 0.36%.
The diff coverage is 93.18%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
src/PathwiseSamplingModule.jl 86.95% <86.95%> (ø)
src/SparseVariationalApproximationModule.jl 96.96% <100.00%> (+0.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8513ad...41eb95e. Read the comment docs.

@rossviljoen rossviljoen changed the title Pathwise Sampling Take 2 Pathwise Sampling (Take 2) Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pathwise sampling
1 participant