Skip to content

Commit 4ab6912

Browse files
authored
Refactor (#13)
* Refactor * fix test bug * Rename to GPLikelihoods * Remove kernelfunctions dependency
1 parent 6d90456 commit 4ab6912

File tree

11 files changed

+37
-99
lines changed

11 files changed

+37
-99
lines changed

Project.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
name = "LatentGPs"
2-
uuid = "45b822f7-b0f9-4a40-9473-dffa0412f8e7"
1+
name = "GPLikelihoods"
2+
uuid = "6031954c-0455-49d7-b3b9-3e1c99afaf40"
33
authors = ["willtebbutt <[email protected]>"]
44
version = "0.1.0"
55

66
[deps]
77
AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918"
88
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
99
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
10-
KernelFunctions = "ec8451be-7e33-11e9-00cf-bbf324bd1392"
11-
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1210
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
13-
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1411

1512
[compat]
16-
AbstractGPs = "0.1.1"
13+
AbstractGPs = "0.2"
1714
Distributions = "0.19, 0.20, 0.21, 0.22, 0.23"
1815
Functors = "0.1"
19-
KernelFunctions = "0.4"
2016
julia = "1.3"

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# LatentGPs
1+
# GPLikelihoods
22

3-
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaGaussianProcesses.github.io/LatentGPs.jl/stable)
4-
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaGaussianProcesses.github.io/LatentGPs.jl/dev)
5-
[![Build Status](https://travis-ci.com/JuliaGaussianProcesses/LatentGPs.jl.svg?branch=master)](https://travis-ci.com/JuliaGaussianProcesses/LatentGPs.jl)
6-
[![Codecov](https://codecov.io/gh/JuliaGaussianProcesses/LatentGPs.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaGaussianProcesses/LatentGPs.jl)
3+
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaGaussianProcesses.github.io/GPLikelihoods.jl/stable)
4+
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaGaussianProcesses.github.io/GPLikelihoods.jl/dev)
5+
[![Build Status](https://travis-ci.com/JuliaGaussianProcesses/GPLikelihoods.jl.svg?branch=master)](https://travis-ci.com/JuliaGaussianProcesses/GPLikelihoods.jl)
6+
[![Codecov](https://codecov.io/gh/JuliaGaussianProcesses/GPLikelihoods.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaGaussianProcesses/GPLikelihoods.jl)
77
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
88
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)

docs/make.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
using Documenter, LatentGPs
1+
using Documenter, GPLikelihoods
22

33
makedocs(;
4-
modules=[LatentGPs],
4+
modules=[GPLikelihoods],
55
format=Documenter.HTML(),
66
pages=[
77
"Home" => "index.md",
88
],
9-
repo="https://github.com/JuliaGaussianProcesses/LatentGPs.jl/blob/{commit}{path}#L{line}",
10-
sitename="LatentGPs.jl",
9+
repo="https://github.com/JuliaGaussianProcesses/GPLikelihoods.jl/blob/{commit}{path}#L{line}",
10+
sitename="GPLikelihoods.jl",
1111
authors="willtebbutt <[email protected]>",
1212
assets=String[],
1313
)
1414

1515
deploydocs(;
16-
repo="github.com/JuliaGaussianProcesses/LatentGPs.jl",
16+
repo="github.com/JuliaGaussianProcesses/GPLikelihoods.jl",
1717
)

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# LatentGPs.jl
1+
# GPLikelihoods.jl
22

33
```@index
44
```
55

66
```@autodocs
7-
Modules = [LatentGPs]
7+
Modules = [GPLikelihoods]
88
```

src/LatentGPs.jl renamed to src/GPLikelihoods.jl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
1-
module LatentGPs
1+
module GPLikelihoods
22

33
using Distributions
4-
using KernelFunctions
54
using AbstractGPs
6-
using LinearAlgebra
75
using Random
86
using Functors
97

10-
import Statistics
118
import Distributions
129

13-
export LatentGP
14-
15-
export logpdf, rand
16-
1710
export GaussianLikelihood, PoissonLikelihood
1811

19-
20-
include("latent_gp.jl")
21-
2212
# Likelihoods
2313
include("likelihoods/gaussian.jl")
2414
include("likelihoods/poisson.jl")

src/latent_gp.jl

Lines changed: 0 additions & 30 deletions
This file was deleted.

test/Project.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918"
33
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
44
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
5-
KernelFunctions = "ec8451be-7e33-11e9-00cf-bbf324bd1392"
6-
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
75
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
86
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
97

108
[compat]
11-
AbstractGPs = "0.1.1"
9+
AbstractGPs = "0.2"
1210
Distributions = "0.19, 0.20, 0.21, 0.22, 0.23"
13-
KernelFunctions = "0.4"
11+
Functors = "0.1"
1412
julia = "1.3"

test/latent_gp.jl

Lines changed: 0 additions & 15 deletions
This file was deleted.

test/likelihoods/gaussian.jl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
@testset "GaussianLikelihood" begin
2+
rng = MersenneTwister(123)
23
gp = GP(SqExponentialKernel())
3-
x = rand(10)
4-
y = rand(10)
5-
fx = gp(x, 1e-5)
6-
lik = GaussianLikelihood(first(fx.Σy))
7-
lgp = LatentGP(fx, lik)
8-
9-
@test typeof(lik(rand(fx))) <: Distribution
10-
@test length(rand(lik(rand(fx)))) == 10
4+
x = rand(rng, 10)
5+
y = rand(rng, 10)
6+
lik = GaussianLikelihood(1e-5)
7+
lgp = LatentGP(gp, lik, 1e-5)
8+
lfgp = lgp(x)
9+
10+
@test typeof(lik(rand(rng, lfgp.fx))) <: Distribution
11+
@test length(rand(rng, lik(rand(rng, lfgp.fx)))) == 10
1112
@test keys(Functors.functor(lik)[1]) == (:σ²,)
1213
end

test/likelihoods/poisson.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
@testset "PoissonLikelihood" begin
2+
rng = MersenneTwister(123)
23
gp = GP(SqExponentialKernel())
3-
x = rand(10)
4-
y = rand(10)
5-
fx = gp(x, 1e-6)
4+
x = rand(rng, 10)
5+
y = rand(rng, 10)
66
lik = PoissonLikelihood()
7-
lgp = LatentGP(fx, lik)
7+
lgp = LatentGP(gp, lik, 1e-5)
8+
lfgp = lgp(x)
89

9-
@test typeof(lik(rand(fx))) <: Distribution
10-
@test length(rand(lik(rand(fx)))) == 10
10+
@test typeof(lik(rand(rng, lfgp.fx))) <: Distribution
11+
@test length(rand(rng, lik(rand(rng, lfgp.fx)))) == 10
12+
@test Functors.functor(lik)[1] == ()
1113
end

0 commit comments

Comments
 (0)