Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
AbstractGPs = "0.3, 0.4, 0.5"
AbstractGPs = "0.5.17"
ChainRulesCore = "1.7"
Distributions = "0.25"
FastGaussQuadrature = "0.4, 0.5"
Expand Down
10 changes: 1 addition & 9 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ module API

export approx_lml # TODO move to AbstractGPs, see https://github.com/JuliaGaussianProcesses/AbstractGPs.jl/issues/221

"""
approx_lml(approx::<Approximation>, lfx::LatentFiniteGP, ys)

Compute an approximation to the log of the marginal likelihood (also known as
"evidence") under the given `approx` to the posterior. This approximation can be used to optimise the hyperparameters of `lfx`.

This should become part of the AbstractGPs API (see JuliaGaussianProcesses/AbstractGPs.jl#221).
"""
function approx_lml end
@deprecate approx_lml(approx, lfx::LatentFiniteGP, ys) approx_log_evidence(approx, lfx, ys)

end
4 changes: 2 additions & 2 deletions src/LaplaceApproximationModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ function AbstractGPs.posterior(la::LaplaceApproximation, lfx::LatentFiniteGP, ys
end

"""
approx_lml(la::LaplaceApproximation, lfx::LatentFiniteGP, ys)
approx_log_evidence(la::LaplaceApproximation, lfx::LatentFiniteGP, ys)

Compute an approximation to the log of the marginal likelihood (also known as
"evidence"), which can be used to optimise the hyperparameters of `lfx`.

This should become part of the AbstractGPs API (see JuliaGaussianProcesses/AbstractGPs.jl#221).
"""
function API.approx_lml(la::LaplaceApproximation, lfx::LatentFiniteGP, ys)
function AbstractGPs.approx_log_evidence(la::LaplaceApproximation, lfx::LatentFiniteGP, ys)
return laplace_lml(lfx, ys; la.newton_kwargs...)
end

Expand Down
4 changes: 2 additions & 2 deletions src/SparseVariationalApproximationModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ inducing_points(f::ApproxPosteriorGP{<:SparseVariationalApproximation}) = f.appr
# elbo
#

function API.approx_lml(
function AbstractGPs.approx_log_evidence(
sva::SparseVariationalApproximation, l_fx::Union{FiniteGP,LatentFiniteGP}, ys; kwargs...
)
return AbstractGPs.elbo(sva, l_fx, ys; kwargs...)
return elbo(sva, l_fx, ys; kwargs...)
end

"""
Expand Down
4 changes: 2 additions & 2 deletions src/TestUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function build_latent_gp(theta)
end

"""
test_approx_lml(approx)
test_approx_log_evidence(approx)

Test whether in the conjugate case `approx_lml(approx, LatentGP(f,
GaussianLikelihood(), jitter)(x), y)` gives approximately the same answer as
Expand All @@ -51,7 +51,7 @@ the log marginal likelihood in exact GP regression.
!!! todo
Also test gradients (for hyperparameter optimization).
"""
function test_approx_lml end
function test_approx_log_evidence end

"""
test_approximation_predictions(approx)
Expand Down