Skip to content

Commit f31a495

Browse files
authored
Tidy up and deprecate approx_posterior (#218)
* Remove redundant tests * Deprecate approx_posterior * Update NEWS * Deprecate approx_posterior * Bump patch
1 parent c822896 commit f31a495

File tree

11 files changed

+24
-74
lines changed

11 files changed

+24
-74
lines changed

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ between versions, and discuss new features.
66
If you find a breaking change this is not reported here, please either raise an issue or
77
make a PR to ammend this document.
88

9+
## 0.7.16
10+
- Deprecate `approx_posterior` in favour of `posterior`. This is being removed because it has been removed in AbstractGPs in favour of `posterior`. It will be entirely removed in the next breaking release.
11+
- Remove some redundant testing infrastructure and tidy up the file structure slightly.
12+
13+
## 0.7.15
14+
Enable WrappedGP to work with any AbstractGP, not just the GP type.
15+
916
## 0.7.14
1017

1118
AbstractGPs now takes care of everything sparsity-related.

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Stheno"
22
uuid = "8188c328-b5d6-583d-959b-9690869a5511"
3-
version = "0.7.16"
3+
version = "0.7.17"
44

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

examples/gppp_and_pseudo_points/1d_additive.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ scatter!(posterior_plot, x.x, y;
7575
M3 = 25;
7676
z = GPPPInput(:f3, collect(range(0, T; length=M3)));
7777
u = f(z, 1e-9);
78-
f′_approx = approx_posterior(VFE(), fx, y, u);
78+
f′_approx = posterior(VFE(), fx, y, u);
7979

8080
@show elbo(fx, y, u);
8181

@@ -118,7 +118,7 @@ z1 = GPPPInput(:f1, collect(range(0.0; step=1 / ω, length=M1)));
118118
z2 = GPPPInput(:f2, collect(range(0.0; step=T, length=M2)));
119119
z12 = BlockData(z1, z2);
120120
u12 = f(z12, 1e-9);
121-
f′_approx_12 = approx_posterior(VFE(), fx, y, u12);
121+
f′_approx_12 = posterior(VFE(), fx, y, u12);
122122

123123
@show elbo(fx, y, u12);
124124

examples/pseudo_points/basic_operations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ display(@benchmark elbo($fx, $y, $u))
5656
println()
5757

5858
# Compute the approximate posterior process.
59-
f_post = approx_posterior(VFE(), fx, y, u);
59+
f_post = posterior(VFE(), fx, y, u);
6060

6161
# Specify some points at which to plot the approximate posterior.
6262
Npr = 1000

src/Stheno.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ module Stheno
2626
elbo,
2727
dtc,
2828
posterior,
29-
approx_posterior,
3029
marginals
3130

3231
using MacroTools: @capture, combinedef, postwalk, splitdef
@@ -36,7 +35,7 @@ module Stheno
3635
# Various bits of utility that aren't inherently GP-related. Often very type-piratic.
3736
include(joinpath("util", "zygote_rules.jl"))
3837
include(joinpath("util", "covariance_matrices.jl"))
39-
include(joinpath("util", "block_arrays", "dense.jl"))
38+
include(joinpath("util", "dense.jl"))
4039
include(joinpath("util", "abstract_data_set.jl"))
4140
include(joinpath("util", "proper_type_piracy.jl"))
4241

src/deprecate.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33

44
using KernelFunctions: NeuralKernelNetwork
55
export NeuralKernelNetwork
6+
7+
@deprecate approx_posterior posterior

src/sparse_finite_gp.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ A finite-dimensional projection of an `AbstractGP` `f` at locations `x`, which u
1111
`FiniteGP` defined at a sparse set of inducing points [1] to do approximate inference.
1212
1313
This object has similar methods to an ordinary `FiniteGP`, but when you call `logpdf` on it,
14-
it actually computes the `elbo`, and when you call `posterior` on it, `approx_posterior` is
15-
called.
14+
it actually computes the `elbo`, and when you call `posterior` on it, you get an approximate
15+
posterior.
1616
1717
[1] - M. K. Titsias. "Variational learning of inducing variables in sparse Gaussian
1818
processes". In: Proceedings of the Twelfth International Conference on Artificial
File renamed without changes.

test/runtests.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@ include("test_util.jl")
5555
@timedtestset "util" begin
5656
include(joinpath("util", "zygote_rules.jl"))
5757
include(joinpath("util", "covariance_matrices.jl"))
58-
@testset "block_arrays" begin
59-
include(joinpath("util", "block_arrays", "test_util.jl"))
60-
include(joinpath("util", "block_arrays", "dense.jl"))
61-
end
58+
include(joinpath("util", "dense.jl"))
6259
include(joinpath("util", "abstract_data_set.jl"))
6360
end
6461

test/util/block_arrays/test_util.jl

Lines changed: 0 additions & 61 deletions
This file was deleted.

test/util/block_arrays/dense.jl renamed to test/util/dense.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
@timedtestset "dense" begin
2-
2+
@timedtestset "fdm stuff" begin
3+
rng, Ps, Qs = MersenneTwister(123456), [5, 4], [3, 2, 1]
4+
X = mortar([randn(rng, P, Q) for P in Ps, Q in Qs], Ps, Qs)
5+
vec_X, from_vec = FiniteDifferences.to_vec(X)
6+
@test vec_X isa Vector
7+
@test from_vec(vec_X) == X
8+
end
39
@timedtestset "Stheno._collect ∘ mortar" begin
410
@timedtestset "BlockVector" begin
511

0 commit comments

Comments
 (0)