Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Massive update #90

Merged
merged 102 commits into from
Mar 21, 2023
Merged
Changes from 1 commit
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
369b0ea
Small clean-up
theogf Nov 8, 2022
215305e
Better path for tests
theogf Nov 8, 2022
0954704
Small docs and formatting
theogf Nov 15, 2022
cf6ff79
Docs on GROUP variable
theogf Dec 13, 2022
a1fdb18
Solve parser error on benchmark
theogf Dec 13, 2022
70a6f99
Some clean up and removal of inference test
theogf Dec 13, 2022
3f2179c
Add size function to LGSSM
theogf Dec 13, 2022
dd1bd9e
Remove more check_infers
theogf Dec 13, 2022
1461ac5
Fixes and use flags for inference and allocations
theogf Dec 13, 2022
c4ecf9c
New temp fix for tests
theogf Dec 13, 2022
a091196
Additional fixes
theogf Dec 13, 2022
299c69e
Remove deprecation warnings
theogf Dec 13, 2022
84a9dd4
Remove Zygote hacks
theogf Dec 20, 2022
5370774
Fixing compilation issues
theogf Dec 20, 2022
738289a
move no grad pullback
theogf Dec 20, 2022
b70887b
Use ChainRulesCore
theogf Dec 20, 2022
fbb4288
Replace with rrule there and there
theogf Dec 20, 2022
2288c18
More replacements
theogf Jan 3, 2023
b8f63c2
Things are finally running
theogf Jan 3, 2023
21117ff
Added CosineKernel
theogf Jan 3, 2023
4b05649
Remove all @adjoint
theogf Jan 3, 2023
15a5812
Return files where they belong
theogf Jan 3, 2023
de76d54
Hunting nothing
theogf Jan 3, 2023
4658e91
Updates on AD system
theogf Jan 10, 2023
532a122
Working version
theogf Jan 17, 2023
d984f50
Fix chain rules
theogf Jan 17, 2023
16acaa1
File renaming
theogf Jan 17, 2023
c91842a
adjustement rrule Fill
theogf Jan 17, 2023
1667c5e
Additional edits
theogf Jan 24, 2023
ad2c079
WIP tests
theogf Jan 24, 2023
e986307
Fix `adjoint_test`
theogf Jan 24, 2023
d7f1d11
Removed faulty tests and adapted others
theogf Jan 24, 2023
0839ddf
Remove @show
theogf Jan 24, 2023
f950cef
Solve models issues
theogf Jan 24, 2023
ca32383
Fixed models
theogf Jan 24, 2023
455509c
revert
theogf Jan 24, 2023
a973ef3
Using `ProjectTo` instead of `rrule`
theogf Jan 24, 2023
8126411
Update linear_gaussian_conditionals.jl
theogf Jan 30, 2023
b34829f
Rework rules
theogf Jan 31, 2023
54495c0
Merge branch 'tgf/clean-up' of github.com:JuliaGaussianProcesses/Temp…
theogf Jan 31, 2023
92eb20a
wip tests
theogf Jan 31, 2023
4145412
Wrok on test_rrule
theogf Jan 31, 2023
916032f
Readd more tests
theogf Feb 7, 2023
4fb9bf7
Fix some tests
theogf Feb 7, 2023
b873efd
check_infers to check_inferred
theogf Feb 7, 2023
4da4e8c
Test tweaks
theogf Feb 7, 2023
72063c4
Remove @showgrad
theogf Feb 7, 2023
bed52a0
Fix example
theogf Feb 14, 2023
a946f34
Replace Mersenne by Xoshiro
theogf Feb 14, 2023
1715423
Passing tests for LGC
theogf Feb 14, 2023
ea482e8
Revert to_vec
theogf Feb 14, 2023
f2d3bf2
Fixing additional rules
theogf Feb 21, 2023
c53e937
Fix chainrules tests
theogf Feb 21, 2023
2e718e7
wip
theogf Feb 21, 2023
4aed49e
using test
theogf Feb 21, 2023
b581f58
leftover infiltrate
theogf Feb 22, 2023
2880e3c
Restore some things
theogf Feb 28, 2023
2e3db0e
Additional stupid things needed
theogf Feb 28, 2023
ca92365
Missing default rtol atol
theogf Feb 28, 2023
0f2de45
Remove non-passing test
theogf Feb 28, 2023
1ac7715
Fix rrule
theogf Feb 28, 2023
9a2606f
Fix on chain rule
theogf Feb 28, 2023
51f8653
Update pseudo_point tests
theogf Feb 28, 2023
2842401
trailing lines
theogf Feb 28, 2023
31e0e6c
Turn off `rand` tests for LGSSM
theogf Feb 28, 2023
3b2cb04
Remove @nograd
theogf Feb 28, 2023
f7767e3
Fix missing part 2
theogf Feb 28, 2023
30cc371
use @info
theogf Feb 28, 2023
ef5614d
Fix pseudo_point.jl
theogf Feb 28, 2023
2890cee
Forgot one!
theogf Feb 28, 2023
144df30
Final brush
theogf Feb 28, 2023
69f4b2d
Revert gradient comp
theogf Feb 28, 2023
e95f562
Minor fix exact_time_learning
theogf Feb 28, 2023
96ac5e2
Revert dev changes
theogf Feb 28, 2023
2221bae
Revert Xoshiro -> MersenneTwister
theogf Feb 28, 2023
01fddac
Update .JuliaFormatter.toml
theogf Mar 14, 2023
36006e9
Lower-bound to 1.8
theogf Mar 14, 2023
e1e4a21
Remove commented out section
theogf Mar 14, 2023
7527727
Comment out harmonise method
theogf Mar 14, 2023
08bcd31
Remove commented out sections
theogf Mar 14, 2023
9dfccd7
Remove trailing whitespaces
theogf Mar 14, 2023
c9be803
Merge branch 'tgf/clean-up' of github.com:JuliaGaussianProcesses/Temp…
theogf Mar 14, 2023
1b15d58
Revert harmonise change
theogf Mar 14, 2023
117c34d
Revert 1.6
theogf Mar 14, 2023
512b686
Use new testset_name funcitonality
theogf Mar 14, 2023
f2e0b41
Clean up chainrules
theogf Mar 14, 2023
4ae01da
Fix chainrules test
theogf Mar 15, 2023
defc316
Add test_broken to indicate issues
theogf Mar 15, 2023
6d2ae25
Update checkout version
theogf Mar 15, 2023
a93ab3a
Remove cancel.yml
theogf Mar 15, 2023
038fca2
Update cache version
theogf Mar 15, 2023
62fd8db
Fix lgssm tests
theogf Mar 15, 2023
93aad43
Remove Statistics
theogf Mar 15, 2023
4ec98c5
Revert change get_adjoint_storage
theogf Mar 15, 2023
48c5dee
Fix lgssm tests (maybe)
theogf Mar 21, 2023
87068c6
Update test Project compat
theogf Mar 21, 2023
b772f90
Fixing FillArrays to 0.13.7
theogf Mar 21, 2023
fe052e9
Fix FillArrays for real
theogf Mar 21, 2023
63c2a0c
Readd Pkg
theogf Mar 21, 2023
f7dcb63
Use ChainRulesTestUtils.rand_tangent
theogf Mar 21, 2023
e139852
Comment out failing tests
theogf Mar 21, 2023
fbd2c01
Revert "Use ChainRulesTestUtils.rand_tangent"
theogf Mar 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 7 additions & 62 deletions test/util/chainrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,74 +93,19 @@ include("../test_util.jl")
foo(a, x1, x2) = _map((z1, z2) -> a * sin.(z1 .* z2), x1, x2)
test_rrule(ZygoteRuleConfig(), foo, randn(), x1, x2; check_inferred=false, rrule_f=rrule_via_ad)
end
# @testset "$N, $T" for N in [1, 2, 3], T in [Float32, Float64]

# rng = MersenneTwister(123456)

# # Do dense stuff.
# S_ = randn(rng, T, N, N)
# S = S_ * S_' + I
# C = cholesky(S)
# Ss = SMatrix{N, N, T}(S)
# Cs = cholesky(Ss)

# @testset "cholesky" begin
# C_fwd, pb = Zygote.pullback(cholesky, Symmetric(S))
# Cs_fwd, pbs = Zygote.pullback(cholesky, Symmetric(Ss))

# @test eltype(C_fwd) == T
# @test eltype(Cs_fwd) == T

# ΔC = randn(rng, T, N, N)
# ΔCs = SMatrix{N, N, T}(ΔC)

# @test C.U ≈ Cs.U
# @test Cs.U ≈ Cs_fwd.U

# ΔS, = pb((factors=ΔC, ))
# ΔSs, = pbs((factors=ΔCs, ))

# @test ΔS ≈ ΔSs.data
# @test eltype(ΔS) == T
# @test eltype(ΔSs.data) == T

# @test allocs(@benchmark(cholesky(Symmetric($Ss)); samples=1, evals=1)) == 0
# @test allocs(@benchmark(Zygote._pullback($(Context()), cholesky, Symmetric($Ss)); samples=1, evals=1)) == 0
# @test allocs(@benchmark($pbs((factors=$ΔCs,)); samples=1, evals=1)) == 0
# end
# @testset "logdet" begin
# @test logdet(Cs) ≈ logdet(C)
# C_fwd, pb = logdet_pullback(C)
# Cs_fwd, pbs = logdet_pullback(Cs)

# @test eltype(C_fwd) == T
# @test eltype(Cs_fwd) == T

# @test logdet(Cs) ≈ Cs_fwd

# Δ = randn(rng, T)
# ΔC = first(pb(Δ)).factors
# ΔCs = first(pbs(Δ)).factors

# @test ΔC ≈ ΔCs
# @test eltype(ΔC) == T
# @test eltype(ΔCs) == T

# @test allocs(@benchmark(logdet($Cs); samples=1, evals=1)) == 0
# @test allocs(@benchmark(logdet_pullback($Cs); samples=1, evals=1)) == 0
# @test allocs(@benchmark($pbs($Δ); samples=1, evals=1)) == 0
# end
# end
@testset "StructArray" begin
a = randn(5)
b = rand(5)
test_rrule(StructArray, (a, b))
# This test is broken due to FiniteDifferences returning the wrong Tangent.
theogf marked this conversation as resolved.
Show resolved Hide resolved
# test_rrule(StructArray, (a, b); check_inferred=false)

xs = [Gaussian(randn(1), randn(1, 1)) for _ in 1:2]
ms = getfield.(xs, :m)
Ps = getfield.(xs, :P)
test_rrule(StructArray{eltype(xs)}, (ms, Ps))
# xs_sa = StructArray{eltype(xs)}((ms, Ps))
# test_rrule(ZygoteRuleConfig(), getproperty, xs_sa, :m; rrule_f=rrule_via_ad)
# Same here.
# test_rrule(StructArray{eltype(xs)}, (ms, Ps))
xs_sa = StructArray{eltype(xs)}((ms, Ps))
# And here.
# test_zygote_grad(getproperty, xs_sa, :m)
end
end