Skip to content

Commit

Permalink
Merge pull request #90 from JuliaGaussianProcesses/tgf/clean-up
Browse files Browse the repository at this point in the history
Massive update
  • Loading branch information
theogf committed Mar 21, 2023
2 parents f53eaa0 + fbd2c01 commit 1922596
Show file tree
Hide file tree
Showing 46 changed files with 1,145 additions and 1,140 deletions.
1 change: 1 addition & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style = "blue"
2 changes: 1 addition & 1 deletion .github/workflows/VersionVigilante_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
VersionVigilante:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1.0.0
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@latest
- name: VersionVigilante.main
id: versionvigilante_main
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/cancel.yml

This file was deleted.

12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ on:
branches:
- master
pull_request:

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.group }}
Expand All @@ -13,6 +20,7 @@ jobs:
matrix:
version:
- '1'
- '1.6'
os:
- ubuntu-latest
arch:
Expand All @@ -24,12 +32,12 @@ jobs:
- 'test gp'
- 'test space_time'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
- uses: actions/cache@v3
env:
cache-name: cache-artifacts
with:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on:
pull_request:
branches:
- master

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
examples:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
Expand All @@ -20,7 +27,7 @@ jobs:
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
/test/dev
/docs/build/
/docs/site/
.vscode/

# Things in bench that shouldn't be tracked because they may contain large files.
bench/dev
bench/data
bench/plots

# Things generated by examples
*.png
16 changes: 7 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TemporalGPs"
uuid = "e155a3c4-0841-43e1-8b83-a0e4f03cc18f"
authors = ["willtebbutt <wt0881@my.bristol.ac.uk>"]
version = "0.5.13"
authors = ["willtebbutt <wt0881@my.bristol.ac.uk> and contributors"]
version = "0.6.0"

[deps]
AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918"
Expand All @@ -14,16 +14,14 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"

[compat]
AbstractGPs = "0.2, 0.3"
AbstractGPs = "0.5"
BlockDiagonals = "0.1.7"
ChainRulesCore = "0.9, 0.10"
FillArrays = "0.10, 0.11, 0.12"
ChainRulesCore = "1"
FillArrays = "0.13.0 - 0.13.7"
KernelFunctions = "0.9, 0.10.1"
StaticArrays = "1"
StructArrays = "0.5"
StructArrays = "0.5, 0.6"
Zygote = "0.6"
ZygoteRules = "0.2"
julia = "1.5"
julia = "1.6"
24 changes: 12 additions & 12 deletions bench/mul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ C = randn(rng, Q, Q);
@benchmark mul!($C, $A, $B, 1.0, 1.0)
@benchmark mul!($C, $A_dense, $B, 1.0, 1.0)

@benchmark mul!($C, $At', $B, 1.0, 1.0)
@benchmark mul!($C, $At_dense', $B, 1.0, 1.0)
@benchmark mul!($C, $(At'), $B, 1.0, 1.0)
@benchmark mul!($C, $(At_dense'), $B, 1.0, 1.0)

@benchmark mul!($C, $A, $B', 1.0, 1.0)
@benchmark mul!($C, $A_dense, $B', 1.0, 1.0)
@benchmark mul!($C, $A, $(B'), 1.0, 1.0)
@benchmark mul!($C, $A_dense, $(B'), 1.0, 1.0)

@benchmark mul!($C, $At', $B', 1.0, 1.0)
@benchmark mul!($C, $At_dense', $B', 1.0, 1.0)
@benchmark mul!($C, $(At'), $(B'), 1.0, 1.0)
@benchmark mul!($C, $(At_dense'), $(B'), 1.0, 1.0)

@benchmark mul!($C, $B, $A, 1.0, 1.0)
@benchmark mul!($C, $B, $A_dense, 1.0, 1.0)

@benchmark mul!($C, $B, $At', 1.0, 1.0)
@benchmark mul!($C, $B, $At_dense', 1.0, 1.0)
@benchmark mul!($C, $B, $(At'), 1.0, 1.0)
@benchmark mul!($C, $B, $(At_dense'), 1.0, 1.0)

@benchmark mul!($C, $B', $A, 1.0, 1.0)
@benchmark mul!($C, $B', $A_dense, 1.0, 1.0)
@benchmark mul!($C, $(B'), $A, 1.0, 1.0)
@benchmark mul!($C, $(B'), $A_dense, 1.0, 1.0)

@benchmark mul!($C, $B', $At', 1.0, 1.0)
@benchmark mul!($C, $B', $At_dense', 1.0, 1.0)
@benchmark mul!($C, $(B'), $(At'), 1.0, 1.0)
@benchmark mul!($C, $(B'), $(At_dense'), 1.0, 1.0)

# Matrix-Vector multiplies.

Expand Down
65 changes: 36 additions & 29 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,44 +1,49 @@
# This file is machine-generated - editing it directly is not advised

[[ANSIColoredPrinters]]
git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c"
uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9"
version = "0.0.1"

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[DocStringExtensions]]
deps = ["LibGit2", "Markdown", "Pkg", "Test"]
git-tree-sha1 = "88bb0edb352b16608036faadcc071adda068582a"
deps = ["LibGit2"]
git-tree-sha1 = "c36550cb29cbe373e95b3f40486b9a4148f89ffd"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.8.1"
version = "0.9.2"

[[Documenter]]
deps = ["Base64", "Dates", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
git-tree-sha1 = "3bacd94d853a6bccaee1d0104d8b06d29a7506ac"
deps = ["ANSIColoredPrinters", "Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
git-tree-sha1 = "6030186b00a38e9d0434518627426570aac2ef95"
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "0.24.6"
version = "0.27.23"

[[IOCapture]]
deps = ["Logging", "Random"]
git-tree-sha1 = "f7be53659ab06ddc986428d3a9dcc95f6fa6705a"
uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
version = "0.2.2"

[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e"
git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.0"
version = "0.21.3"

[[LibGit2]]
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

Expand All @@ -49,44 +54,46 @@ uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
version = "1.2.0"

[[Parsers]]
deps = ["Dates", "Test"]
git-tree-sha1 = "0c16b3179190d3046c073440d94172cfc3bb0553"
deps = ["Dates", "SnoopPrecompile"]
git-tree-sha1 = "cceb0257b662528ecdf0b4b4302eb00e767b38e7"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "0.3.12"

[[Pkg]]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Test", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
version = "2.5.0"

[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[Random]]
deps = ["Serialization"]
deps = ["SHA", "Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[SnoopPrecompile]]
git-tree-sha1 = "f604441450a3c0569830946e5b33b78c928e1a85"
uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c"
version = "1.0.1"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
4 changes: 2 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ makedocs(;
pages=[
"Home" => "index.md",
],
repo="https://github.com/willtebbutt/TemporalGPs.jl/blob/{commit}{path}#L{line}",
repo="https://github.com/JuliaGaussianProcesses/TemporalGPs.jl/blob/{commit}{path}#L{line}",
sitename="TemporalGPs.jl",
authors="willtebbutt <wt0881@my.bristol.ac.uk>",
assets=String[],
)

deploydocs(;
repo="github.com/willtebbutt/TemporalGPs.jl",
repo="github.com/JuliaGaussianProcesses/TemporalGPs.jl",
)
1 change: 1 addition & 0 deletions examples/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[deps]
AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
KernelFunctions = "ec8451be-7e33-11e9-00cf-bbf324bd1392"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
ParameterHandling = "2412ca09-6db7-441c-8e3a-88d5709968c5"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Expand Down
2 changes: 1 addition & 1 deletion examples/exact_space_time_learning.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ training_results = Optim.optimize(

# Extracting the final values of the parameters.
# Should be close to truth.
final_params = unpack(training_results.minimizer);
final_params = unpack(training_results.minimizer)

# Construct the posterior as per usual.
f_post = posterior(build_gp(final_params)(x, final_params.var_noise), y);
Expand Down
10 changes: 5 additions & 5 deletions examples/exact_time_learning.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ using Zygote # Algorithmic Differentiation
# Declare model parameters using `ParameterHandling.jl` types.
# var_kernel is the variance of the kernel, λ the inverse length scale, and var_noise the
# variance of the observation noise. Note that they're all constrained to be positive.
flat_initial_params, unflatten = ParameterHandling.flatten((
flat_initial_params, unpack = ParameterHandling.value_flatten((
var_kernel = positive(0.6),
λ = positive(0.1),
var_noise = positive(2.0),
));

# Construct a function to unpack flattened parameters and pull out the raw values.
unpack = ParameterHandling.value unflatten;
# Pull out the raw values.
params = unpack(flat_initial_params);

function build_gp(params)
Expand All @@ -37,6 +36,7 @@ T = 1_000_000;
x = RegularSpacing(0.0, 1e-4, T);

# Generate some noisy synthetic data from the GP.
f = build_gp(params)
y = rand(f(x, params.var_noise));

# Specify an objective function for Optim to minimise in terms of x and y.
Expand All @@ -60,7 +60,7 @@ training_results = Optim.optimize(
);

# Extracting the final values of the parameters. Should be moderately close to truth.
final_params = unpack(training_results.minimizer);
final_params = unpack(training_results.minimizer)

# Construct the posterior as per usual.
f_final = build_gp(final_params)
Expand All @@ -84,6 +84,6 @@ if get(ENV, "TESTING", "FALSE") == "FALSE"
plt = plot();
scatter!(plt, x, y; label="", markersize=0.1, alpha=0.1);
plot!(plt, f_post(x_pr); ribbon_scale=3.0, label="");
plot!(x_pr, f_post_samples; color=:red, label="");
plot!(plt, x_pr, f_post_samples; color=:red, label="");
savefig(plt, "posterior.png");
end
Loading

2 comments on commit 1922596

@theogf
Copy link
Member Author

@theogf theogf commented on 1922596 Mar 21, 2023

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/80028

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.6.0 -m "<description of version>" 1922596b72b839d0364e50565210d3f1ff660bdd
git push origin v0.6.0

Please sign in to comment.