diff --git a/Project.toml b/Project.toml index c01ff791..2625a7c6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "AbstractGPs" uuid = "99985d1d-32ba-4be9-9821-2ec096f28918" authors = ["JuliaGaussianProcesses Team"] -version = "0.5.3" +version = "0.6.0" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" diff --git a/docs/Project.toml b/docs/Project.toml index 5667f86a..6cd49f57 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -4,5 +4,5 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [compat] -AbstractGPs = "0.4, 0.5" +AbstractGPs = "0.4, 0.5, 0.6" Documenter = "0.27" diff --git a/src/AbstractGPs.jl b/src/AbstractGPs.jl index 15b3812e..acf03c13 100644 --- a/src/AbstractGPs.jl +++ b/src/AbstractGPs.jl @@ -30,7 +30,6 @@ export GP, VFE, DTC, update_posterior, - LatentGP, ColVecs, RowVecs @@ -53,9 +52,6 @@ include("exact_gpr_posterior.jl") # Approximate sparse GP inference for Gaussian likelihood. include("sparse_approximations.jl") -# LatentGP and LatentFiniteGP objects to accommodate GPs with non-Gaussian likelihoods. -include("latent_gp.jl") - # Plotting utilities. include("util/plotting.jl") diff --git a/src/latent_gp.jl b/src/latent_gp.jl deleted file mode 100644 index 27a6a776..00000000 --- a/src/latent_gp.jl +++ /dev/null @@ -1,50 +0,0 @@ -""" - LatentGP(f<:AbstractGP, lik, Σy) - - - `f` is a `AbstractGP`. - - `lik` is the likelihood function which maps samples from `f` to the - corresponding conditional likelihood distributions (i.e., `lik` must return a - `Distribution` compatible with the observations). - - `Σy` is the noise under which the latent GP is "observed"; this represents - the jitter used to avoid numeric instability and should generally be small. -""" -struct LatentGP{Tf<:AbstractGP,Tlik,TΣy} - f::Tf - lik::Tlik - Σy::TΣy -end - -""" - LatentFiniteGP(fx<:FiniteGP, lik) - - - `fx` is a `FiniteGP`. - - `lik` is the likelihood function which maps samples from `f` to the - corresponding conditional likelihood distributions (i.e., `lik` must return a - `Distribution` compatible with the observations). -""" -struct LatentFiniteGP{Tfx<:FiniteGP,Tlik} - fx::Tfx - lik::Tlik -end - -(lgp::LatentGP)(x) = LatentFiniteGP(lgp.f(x, lgp.Σy), lgp.lik) - -Base.length(lgpx::LatentFiniteGP) = length(lgpx.fx) - -function Distributions.rand(rng::AbstractRNG, lfgp::LatentFiniteGP) - f = rand(rng, lfgp.fx) - y = rand(rng, lfgp.lik(f)) - return (f=f, y=y) -end - -""" - logpdf(lfgp::LatentFiniteGP, y::NamedTuple{(:f, :y)}) - -```math - log p(y, f; x) -``` -The joint log density of the Gaussian process output `f` and observation `y`. -""" -function Distributions.logpdf(lfgp::LatentFiniteGP, y::NamedTuple{(:f, :y)}) - return logpdf(lfgp.fx, y.f) + logpdf(lfgp.lik(y.f), y.y) -end diff --git a/test/latent_gp.jl b/test/latent_gp.jl deleted file mode 100644 index 506dcf92..00000000 --- a/test/latent_gp.jl +++ /dev/null @@ -1,19 +0,0 @@ -@testset "latent_gp" begin - gp = GP(SqExponentialKernel()) - x = rand(10) - y = rand(10) - - lgp = LatentGP(gp, x -> MvNormal(x, 0.1), 1e-5) - @test lgp isa LatentGP - @test lgp.f isa AbstractGPs.AbstractGP - @test lgp.Σy isa Real - - lfgp = lgp(x) - @test lfgp isa AbstractGPs.LatentFiniteGP - @test lfgp.fx isa AbstractGPs.FiniteGP - @test length(lfgp) == length(x) - - f = rand(10) - @test logpdf(lfgp, (f=f, y=y)) isa Real - @test rand(lfgp) isa NamedTuple{(:f, :y)} -end diff --git a/test/ppl/Project.toml b/test/ppl/Project.toml index 11b4c197..7cc5f7e7 100644 --- a/test/ppl/Project.toml +++ b/test/ppl/Project.toml @@ -6,7 +6,7 @@ Soss = "8ce77f84-9b61-11e8-39ff-d17a774bf41c" Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0" [compat] -AbstractGPs = "0.5" +AbstractGPs = "0.6" Distributions = "0.24, 0.25" SampleChainsDynamicHMC = "0.2, 0.3" Soss = "0.19, 0.20" diff --git a/test/runtests.jl b/test/runtests.jl index c037ac58..d7232b98 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -73,10 +73,6 @@ include("test_util.jl") println(" ") @info "Ran posterior_gp tests" - include("latent_gp.jl") - println(" ") - @info "Ran latent_gp tests" - include("deprecations.jl") println(" ") @info "Ran deprecation tests"