From 094bb40e3cd183e9448f5ba8d99ed941c30aec13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Galy-Fajou?= Date: Wed, 12 Jan 2022 11:12:34 +0100 Subject: [PATCH] Remove dependence on KLDivergences.jl (#76) * Remove dependence on KLDivergences * Missing the most important thing * Update Project.toml Co-authored-by: st-- --- Project.toml | 4 +--- docs/Manifest.toml | 8 +------- src/ApproximateGPs.jl | 1 - src/sparse_variational.jl | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Project.toml b/Project.toml index dd4fb4c7..cb5a87cb 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ApproximateGPs" uuid = "298c2ebc-0411-48ad-af38-99e88101b606" authors = ["JuliaGaussianProcesses Team"] -version = "0.2.5" +version = "0.2.6" [deps] AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918" @@ -11,7 +11,6 @@ FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838" FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" GPLikelihoods = "6031954c-0455-49d7-b3b9-3e1c99afaf40" -KLDivergences = "3c9cd921-3d3f-41e2-830c-e020174918cc" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" @@ -27,7 +26,6 @@ FastGaussQuadrature = "0.4" FillArrays = "0.12" ForwardDiff = "0.10" GPLikelihoods = "0.1, 0.2" -KLDivergences = "0.2.1" PDMats = "0.11" Reexport = "1" SpecialFunctions = "1, 2" diff --git a/docs/Manifest.toml b/docs/Manifest.toml index d8732bc3..066be0f0 100644 --- a/docs/Manifest.toml +++ b/docs/Manifest.toml @@ -12,7 +12,7 @@ uuid = "99985d1d-32ba-4be9-9821-2ec096f28918" version = "0.5.3" [[ApproximateGPs]] -deps = ["AbstractGPs", "ChainRulesCore", "Distributions", "FastGaussQuadrature", "FillArrays", "ForwardDiff", "GPLikelihoods", "KLDivergences", "LinearAlgebra", "PDMats", "Reexport", "SpecialFunctions", "Statistics", "StatsBase"] +deps = ["AbstractGPs", "ChainRulesCore", "Distributions", "FastGaussQuadrature", "FillArrays", "ForwardDiff", "GPLikelihoods", "LinearAlgebra", "PDMats", "Reexport", "SpecialFunctions", "Statistics", "StatsBase"] path = ".." uuid = "298c2ebc-0411-48ad-af38-99e88101b606" version = "0.2.3" @@ -190,12 +190,6 @@ git-tree-sha1 = "8076680b162ada2a031f707ac7b4953e30667a37" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" version = "0.21.2" -[[KLDivergences]] -deps = ["ChainRulesCore", "Distances", "Distributions", "LinearAlgebra", "PDMats", "SpecialFunctions", "StatsBase"] -git-tree-sha1 = "b4663db8fb56053b1d1a2af80533b645eba9583a" -uuid = "3c9cd921-3d3f-41e2-830c-e020174918cc" -version = "0.2.1" - [[KernelFunctions]] deps = ["ChainRulesCore", "Compat", "CompositionsBase", "Distances", "FillArrays", "Functors", "IrrationalConstants", "LinearAlgebra", "LogExpFunctions", "Random", "Requires", "SpecialFunctions", "StatsBase", "TensorCore", "Test", "ZygoteRules"] git-tree-sha1 = "9c3d38dafc02feae68a4747813b8b0205fd03da5" diff --git a/src/ApproximateGPs.jl b/src/ApproximateGPs.jl index 1f30ef53..ce26b625 100644 --- a/src/ApproximateGPs.jl +++ b/src/ApproximateGPs.jl @@ -11,7 +11,6 @@ using FastGaussQuadrature using SpecialFunctions using ChainRulesCore using FillArrays -using KLDivergences using PDMats: chol_lower using AbstractGPs: AbstractGP, FiniteGP, LatentFiniteGP, ApproxPosteriorGP, At_A, diag_At_A diff --git a/src/sparse_variational.jl b/src/sparse_variational.jl index 91364bed..531c3c02 100644 --- a/src/sparse_variational.jl +++ b/src/sparse_variational.jl @@ -329,7 +329,7 @@ function _elbo( return sum(variational_exp) * scale - _prior_kl(sva) end -_prior_kl(sva::SparseVariationalApproximation{Centered}) = KL(sva.q, sva.fz) +_prior_kl(sva::SparseVariationalApproximation{Centered}) = kldivergence(sva.q, sva.fz) function _prior_kl(sva::SparseVariationalApproximation{NonCentered}) m_ε = mean(sva.q)