Skip to content

Conversation

@Crown421
Copy link
Member

@Crown421 Crown421 commented Apr 6, 2025

Summary
This PR is a (at this stage) draft PR to allow sampling of GP, including sampling via Cholesky, via Random Fourier Features, and pathwise/ decoupled sampling.

Proposed changes
The main interface revolves around a new GPSampler struct, as a subtype of Random.Sampler, which takes a GP and a "method". One can then draw from this sampler using rand`.

However, there are still issues to this implementation

  • GP must have a kernel (when using RFF)
  • Not yet working with sparse approximations
  • Pathwise functionality was written to (theoretically) enable using Cholesky samples for the prior, and RFF for the posterior, but in practice one would never want to do that.
    • It might not be worth to keep this use case around
  • Multi-Output probably not working yet (and not tested)

What alternatives have you considered?
Making a separate package, and/or (due to the complexity) just keeping it good enough for my needs.

Breaking changes
Should not be breaking (at this point).

@codecov
Copy link

codecov bot commented Apr 6, 2025

Codecov Report

Attention: Patch coverage is 96.84211% with 3 lines in your changes missing coverage. Please review.

Project coverage is 96.33%. Comparing base (05deb6b) to head (c728eb6).

Files with missing lines Patch % Lines
src/sampling.jl 96.84% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #421      +/-   ##
==========================================
+ Coverage   96.21%   96.33%   +0.12%     
==========================================
  Files          12       13       +1     
  Lines         396      491      +95     
==========================================
+ Hits          381      473      +92     
- Misses         15       18       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@willtebbutt
Copy link
Member

Very happy to give this a review -- when you're ready for one, please do tag me.

@Crown421
Copy link
Member Author

Crown421 commented Apr 7, 2025

@willtebbutt If you have some time, I would already appreciate a rough review, on the overall structure/ idea.
I worry that I got too "clever" with the type structure/ relationships/ interface.

FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
IrrationalConstants = "92d709cd-6900-40b7-9082-c6be49f344b6"
KernelFunctions = "ec8451be-7e33-11e9-00cf-bbf324bd1392"
KernelSpectralDensities = "027d52a2-76e5-4228-9bfe-bc7e0f5a8348"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this into a package extension?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants