Skip to content

Commit 57be075

Browse files
committed
support ScalMat in FiniteGP observation covariance
1 parent 8ceb309 commit 57be075

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/LaplaceApproximationModule.jl

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

181181
struct LaplaceCache{
182-
Tm<:AbstractMatrix,Tv<:AbstractVector,Td<:Diagonal,Tf<:Real,Tc<:Cholesky
182+
Tm<:AbstractMatrix,Tv1<:AbstractVector,Tv2<:AbstractVector,Tv3<:AbstractVector,Td<:Diagonal,Tf<:Real,Tc<:Cholesky
183183
}
184184
K::Tm # kernel matrix
185-
f::Tv # mode of posterior p(f | y)
185+
f::Tv1 # mode of posterior p(f | y)
186186
W::Td # diagonal matrix of ∂²/∂fᵢ² loglik
187187
Wsqrt::Td # sqrt(W)
188188
loglik::Tf # ∑ᵢlog p(yᵢ|fᵢ)
189-
d_loglik::Tv # ∂/∂fᵢloglik
189+
d_loglik::Tv2 # ∂/∂fᵢloglik
190190
B_ch::Tc # cholesky(I + Wsqrt * K * Wsqrt)
191-
a::Tv # K⁻¹ f
191+
a::Tv3 # K⁻¹ f
192192
end
193193

194194
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)