Skip to content

Commit

Permalink
bugfix for LaplaceResult (#87)
Browse files Browse the repository at this point in the history
* add test for laplace_steps
  • Loading branch information
st-- authored Jan 10, 2022
1 parent fee8c3d commit 5e475e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 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.2.4"
version = "0.2.5"

[deps]
AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918"
Expand Down
2 changes: 1 addition & 1 deletion src/laplace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ function LaplaceResult(fnew, cache)
q = MvNormal(f, AbstractGPs._symmetric(f_cov))
lml_approx = _laplace_lml(f, cache)

return (; fnew, f_cov, q, lml_approx, cache...)
return (; fnew, f_cov, q, lml_approx, cache)
end

"""
Expand Down
12 changes: 12 additions & 0 deletions test/laplace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,16 @@
@test res_cold.minimizer res_warm.minimizer
end
end

@testset "laplace_steps" begin
X, Y = generate_data()
Random.seed!(123)
theta0 = rand(2)
lf = build_latent_gp(theta0)
lfx = lf(X)

res_array = ApproximateGPs.laplace_steps(lfx, Y)
res = res_array[end]
@test res.q isa MvNormal
end
end

2 comments on commit 5e475e3

@st--
Copy link
Member Author

@st-- st-- commented on 5e475e3 Jan 10, 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/52051

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.2.5 -m "<description of version>" 5e475e3f71144b9675e89d00b3ff4a8dabb5de16
git push origin v0.2.5

Please sign in to comment.