From 245356575c8ec21ac334d85c665c6870851f547a Mon Sep 17 00:00:00 2001 From: WT Date: Wed, 25 Aug 2021 20:49:20 +0100 Subject: [PATCH 1/3] Tweak LatentGP API --- src/latent_gp.jl | 2 +- test/latent_gp.jl | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/latent_gp.jl b/src/latent_gp.jl index caf27ba7..e4116152 100644 --- a/src/latent_gp.jl +++ b/src/latent_gp.jl @@ -26,7 +26,7 @@ struct LatentFiniteGP{Tfx<:FiniteGP,Tlik} lik::Tlik end -(lgp::LatentGP)(x) = LatentFiniteGP(lgp.f(x, lgp.Σy), lgp.lik) +(lgp::LatentGP)(x) = LatentFiniteGP(lgp.f(x, lgp.Σy), lgp.lik(x)) function Distributions.rand(rng::AbstractRNG, lfgp::LatentFiniteGP) f = rand(rng, lfgp.fx) diff --git a/test/latent_gp.jl b/test/latent_gp.jl index 99ecfa07..e2622c23 100644 --- a/test/latent_gp.jl +++ b/test/latent_gp.jl @@ -3,10 +3,9 @@ x = rand(10) y = rand(10) - lgp = LatentGP(gp, x -> MvNormal(x, 0.1), 1e-5) + lgp = LatentGP(gp, x -> (f -> MvNormal(f, 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 From 1bb6e7e4e15b767f7cbb0539b037a40b5c308092 Mon Sep 17 00:00:00 2001 From: WT Date: Wed, 25 Aug 2021 20:49:33 +0100 Subject: [PATCH 2/3] Bump minor version to DEV --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index fe116e2e..04597cdd 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "AbstractGPs" uuid = "99985d1d-32ba-4be9-9821-2ec096f28918" authors = ["JuliaGaussianProcesses Team"] -version = "0.4.0" +version = "0.5.0-DEV" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" From cd59bf743ac10a76a565a196736747e87f3c901d Mon Sep 17 00:00:00 2001 From: WT Date: Wed, 25 Aug 2021 20:55:40 +0100 Subject: [PATCH 3/3] Update docstring --- src/latent_gp.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/latent_gp.jl b/src/latent_gp.jl index e4116152..996b7bff 100644 --- a/src/latent_gp.jl +++ b/src/latent_gp.jl @@ -2,8 +2,10 @@ LatentGP(f<:GP, 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). + - `lik` is a function mapping inputs `x` to a likelihood function, itself mapping samples + from `f` to the corresponding conditional likelihood distributions (i.e., `lik` must + return another function, which returns a `Distribution` compatible with the observations + when called at values of the latent process). - `Σ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. """