Skip to content

Commit b4f17c3

Browse files
Some bugfixes (#125)
* support ScalMat in FiniteGP observation covariance * patch bump * Update src/LaplaceApproximationModule.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 8ceb309 commit b4f17c3

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ApproximateGPs"
22
uuid = "298c2ebc-0411-48ad-af38-99e88101b606"
33
authors = ["JuliaGaussianProcesses Team"]
4-
version = "0.4.0"
4+
version = "0.4.1"
55

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

src/LaplaceApproximationModule.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,22 @@ function _check_laplace_inputs(
179179
end
180180

181181
struct LaplaceCache{
182-
Tm<:AbstractMatrix,Tv<:AbstractVector,Td<:Diagonal,Tf<:Real,Tc<:Cholesky
182+
Tm<:AbstractMatrix,
183+
Tv1<:AbstractVector,
184+
Tv2<:AbstractVector,
185+
Tv3<:AbstractVector,
186+
Td<:Diagonal,
187+
Tf<:Real,
188+
Tc<:Cholesky,
183189
}
184190
K::Tm # kernel matrix
185-
f::Tv # mode of posterior p(f | y)
191+
f::Tv1 # mode of posterior p(f | y)
186192
W::Td # diagonal matrix of ∂²/∂fᵢ² loglik
187193
Wsqrt::Td # sqrt(W)
188194
loglik::Tf # ∑ᵢlog p(yᵢ|fᵢ)
189-
d_loglik::Tv # ∂/∂fᵢloglik
195+
d_loglik::Tv2 # ∂/∂fᵢloglik
190196
B_ch::Tc # cholesky(I + Wsqrt * K * Wsqrt)
191-
a::Tv # K⁻¹ f
197+
a::Tv3 # K⁻¹ f
192198
end
193199

194200
function _laplace_train_intermediates(dist_y_given_f, ys, K, f)

src/SparseVariationalApproximationModule.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using LinearAlgebra
99
using Statistics
1010
using StatsBase
1111
using FillArrays: Fill
12-
using PDMats: chol_lower
12+
using PDMats: chol_lower, ScalMat
1313

1414
using AbstractGPs: AbstractGPs
1515
using AbstractGPs:
@@ -306,7 +306,7 @@ Statistics. PMLR, 2015.
306306
"""
307307
function AbstractGPs.elbo(
308308
sva::SparseVariationalApproximation,
309-
fx::FiniteGP{<:AbstractGP,<:AbstractVector,<:Diagonal{<:Real,<:Fill}},
309+
fx::FiniteGP{<:AbstractGP,<:AbstractVector,<:Union{Diagonal{<:Real,<:Fill},ScalMat}},
310310
y::AbstractVector{<:Real};
311311
num_data=length(y),
312312
quadrature=DefaultExpectationMethod(),

0 commit comments

Comments
 (0)