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

[WIP] Separable GPs #47

Closed
wants to merge 3 commits into from
Closed

[WIP] Separable GPs #47

wants to merge 3 commits into from

Conversation

willtebbutt
Copy link
Member

The intention of this PR is to develop an implementation of separable GPs in Stheno, hoperfully addressing #6 by the time that we're done.

@MichielStock I'll carry on working on this, but let me know what you think. I've just implemented it for problems involving two input dimensions, and I'm hoping that we can nest stuff in a similar manner to Kronecker.jl and automatically get arbitrary numbers of inputs...

@willtebbutt
Copy link
Member Author

willtebbutt commented Oct 15, 2019

Currently gives reasonably performance:

using Stheno, BenchmarkTools
using Stheno: GPC, RectilinearGrid, Separable

f = GP(Separable(eq(), matern32()), GPC());

xl = range(-3.0, 3.0; length=100);
xr = range(-2.5, 2.5; length=100);
x = RectilinearGrid(xl, xr);

y = rand(f(x, 0.1));
logpdf(f(x, 0.1), y)

fx = f(x, 0.1);
@benchmark rand($fx)
y = rand(fx);

@benchmark logpdf($fx, $y)

produces (rand)

BenchmarkTools.Trial: 
  memory estimate:  1.38 MiB
  allocs estimate:  97
  --------------
  minimum time:     7.600 ms (0.00% GC)
  median time:      7.817 ms (0.00% GC)
  mean time:        8.392 ms (0.46% GC)
  maximum time:     32.777 ms (0.00% GC)
  --------------
  samples:          596
  evals/sample:     1

and (logpdf)

BenchmarkTools.Trial: 
  memory estimate:  1.15 MiB
  allocs estimate:  87
  --------------
  minimum time:     6.062 ms (0.00% GC)
  median time:      6.425 ms (0.00% GC)
  mean time:        6.988 ms (0.49% GC)
  maximum time:     32.850 ms (0.00% GC)
  --------------
  samples:          715
  evals/sample:     1

on my machine, which seems about right.

@codecov
Copy link

codecov bot commented Oct 15, 2019

Codecov Report

Merging #47 into master will decrease coverage by 2.45%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
- Coverage   85.93%   83.48%   -2.46%     
==========================================
  Files          24       25       +1     
  Lines         647      666      +19     
==========================================
  Hits          556      556              
- Misses         91      110      +19
Impacted Files Coverage Δ
src/Stheno.jl 100% <ø> (ø) ⬆️
src/extras/separable.jl 0% <0%> (ø)

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 d4e7757...7c84f78. Read the comment docs.

@willtebbutt willtebbutt deleted the wct/separable branch April 12, 2021 20:31
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.

1 participant