Skip to content

Commit

Permalink
Some bugfixes (#125)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
st-- and github-actions[bot] authored Apr 2, 2022
1 parent 8ceb309 commit b4f17c3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ApproximateGPs"
uuid = "298c2ebc-0411-48ad-af38-99e88101b606"
authors = ["JuliaGaussianProcesses Team"]
version = "0.4.0"
version = "0.4.1"

[deps]
AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918"
Expand Down
14 changes: 10 additions & 4 deletions src/LaplaceApproximationModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,22 @@ function _check_laplace_inputs(
end

struct LaplaceCache{
Tm<:AbstractMatrix,Tv<:AbstractVector,Td<:Diagonal,Tf<:Real,Tc<:Cholesky
Tm<:AbstractMatrix,
Tv1<:AbstractVector,
Tv2<:AbstractVector,
Tv3<:AbstractVector,
Td<:Diagonal,
Tf<:Real,
Tc<:Cholesky,
}
K::Tm # kernel matrix
f::Tv # mode of posterior p(f | y)
f::Tv1 # mode of posterior p(f | y)
W::Td # diagonal matrix of ∂²/∂fᵢ² loglik
Wsqrt::Td # sqrt(W)
loglik::Tf # ∑ᵢlog p(yᵢ|fᵢ)
d_loglik::Tv # ∂/∂fᵢloglik
d_loglik::Tv2 # ∂/∂fᵢloglik
B_ch::Tc # cholesky(I + Wsqrt * K * Wsqrt)
a::Tv # K⁻¹ f
a::Tv3 # K⁻¹ f
end

function _laplace_train_intermediates(dist_y_given_f, ys, K, f)
Expand Down
4 changes: 2 additions & 2 deletions src/SparseVariationalApproximationModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using LinearAlgebra
using Statistics
using StatsBase
using FillArrays: Fill
using PDMats: chol_lower
using PDMats: chol_lower, ScalMat

using AbstractGPs: AbstractGPs
using AbstractGPs:
Expand Down Expand Up @@ -306,7 +306,7 @@ Statistics. PMLR, 2015.
"""
function AbstractGPs.elbo(
sva::SparseVariationalApproximation,
fx::FiniteGP{<:AbstractGP,<:AbstractVector,<:Diagonal{<:Real,<:Fill}},
fx::FiniteGP{<:AbstractGP,<:AbstractVector,<:Union{Diagonal{<:Real,<:Fill},ScalMat}},
y::AbstractVector{<:Real};
num_data=length(y),
quadrature=DefaultExpectationMethod(),
Expand Down

2 comments on commit b4f17c3

@st--
Copy link
Member Author

@st-- st-- commented on b4f17c3 Apr 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/57815

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.1 -m "<description of version>" b4f17c3b630d648527b3229a0501fa40256cfe44
git push origin v0.4.1

Please sign in to comment.