diff --git a/Project.toml b/Project.toml index 7aa3bea8c..a4d2c7097 100644 --- a/Project.toml +++ b/Project.toml @@ -51,3 +51,36 @@ Tracker = "0.2.29" Zygote = "0.6" ZygoteRules = "0.2" julia = "1.9" + +[extras] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" +DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0" +DelayDiffEq = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb" +DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def" +Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" +Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" +Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c" +LuxCUDA = "d0bbae9a-e099-4d5b-a835-1c6931763bda" +MLDataUtils = "cc2ba9b6-d476-5e6d-8eaf-a92d5412d41d" +MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458" +NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd" +NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd" +OneHotArrays = "0b1bfda6-eb8a-41d2-88d8-f5af5cad476f" +Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2" +Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" +OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e" +OptimizationOptimisers = "42dfb2eb-d2b4-4451-abcd-913932933ac1" +OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" +RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" +ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" +Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["Aqua", "BenchmarkTools", "CUDA", "DataInterpolations", "DelayDiffEq", "DiffEqCallbacks", "Distances", "Distributed", "Flux", "LuxCUDA", "MLDataUtils", "MLDatasets", "NLopt", "NNlib", "OneHotArrays", "Optimisers", "Optimization", "OptimizationOptimJL", "OptimizationOptimisers", "OrdinaryDiffEq", "Printf", "RecursiveArrayTools", "ReverseDiff", "SafeTestsets", "StaticArrays", "Statistics", "StochasticDiffEq", "Test"] diff --git a/README.md b/README.md index 52989e539..4de5a6a2e 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,6 @@ For information on using the package, [in-development documentation](https://docs.sciml.ai/DiffEqFlux/dev/) for the version of the documentation, which contains the unreleased features. - ## Problem Domain DiffEqFlux.jl is for implicit layer machine learning. diff --git a/test/Project.toml b/test/Project.toml deleted file mode 100644 index 1340f5e68..000000000 --- a/test/Project.toml +++ /dev/null @@ -1,39 +0,0 @@ -[deps] -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" -BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" -CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" -ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66" -DataInterpolations = "82cc6244-b520-54b8-b5a6-8a565e85f1d0" -DelayDiffEq = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb" -DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def" -Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" -Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" -Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" -DistributionsAD = "ced4e74d-a319-5a8a-b0ac-84af2272839c" -Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c" -ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" -GeometricFlux = "7e08b658-56d3-11e9-2997-919d5b31e4ea" -GraphSignals = "3ebe565e-a4b5-49c6-aed2-300248c3a9c1" -LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -Lux = "b2108857-7c20-44ae-9111-449ecde12c47" -LuxCUDA = "d0bbae9a-e099-4d5b-a835-1c6931763bda" -MLDataUtils = "cc2ba9b6-d476-5e6d-8eaf-a92d5412d41d" -MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458" -NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd" -NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd" -OneHotArrays = "0b1bfda6-eb8a-41d2-88d8-f5af5cad476f" -Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2" -Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" -OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e" -OptimizationOptimisers = "42dfb2eb-d2b4-4451-abcd-913932933ac1" -OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" -Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" -Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" -ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" -SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" -StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" -Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" diff --git a/test/neural_gde.jl b/test/neural_gde.jl deleted file mode 100644 index b74539228..000000000 --- a/test/neural_gde.jl +++ /dev/null @@ -1,45 +0,0 @@ -using DiffEqFlux, ComponentArrays, GeometricFlux, GraphSignals, OrdinaryDiffEq, Random, - Test, OptimizationOptimisers, Optimization, Statistics -import Flux - -# Fully Connected Graph -adj_mat = FeaturedGraph(Float32[0 1 1 1 - 1 0 1 1 - 1 1 0 1 - 1 1 1 0]) - -features = [-10.0f0 -9.0f0 9.0f0 10.0f0 - 0.0f0 0.0f0 0.0f0 0.0f0] - -target = Float32[1.0 1.0 0.0 0.0 - 0.0 0.0 1.0 1.0] - -model = Chain( - NeuralODE(WithGraph(adj_mat, GCNConv(2 => 2)), (0.0f0, 1.0f0), Tsit5(); - save_everystep = false, reltol = 1e-3, abstol = 1e-3, save_start = false), - x -> reshape(Array(x), size(x)[1:2])) - -ps, st = Lux.setup(Xoshiro(0), model) -ps = ComponentArray(ps) - -logitcrossentropy(ŷ, y; dims = 1) = mean(.-sum(y .* logsoftmax(ŷ; dims); dims)) - -lux_model = Lux.Experimental.StatefulLuxLayer(model, ps, st) - -initial_loss = logitcrossentropy(lux_model(features, ps), target) - -loss_function(p) = logitcrossentropy(lux_model(features, p), target) - -function callback(p, l) - @info "[NeuralGraphODE] Loss: $l" - return false -end - -optfunc = Optimization.OptimizationFunction((x, p) -> loss_function(x), - Optimization.AutoZygote()) -optprob = Optimization.OptimizationProblem(optfunc, ps) -res = Optimization.solve(optprob, Adam(0.1); callback, maxiters = 100) - -updated_loss = logitcrossentropy(lux_model(features, ps), target) - -@test_broken updated_loss < initial_loss diff --git a/test/runtests.jl b/test/runtests.jl index b89883d31..aba7d99fc 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -18,9 +18,6 @@ const is_CI = haskey(ENV, "CI") @safetestset "Neural DE Tests" begin include("neural_de.jl") end - @safetestset "Neural Graph DE" begin - include("neural_gde.jl") - end @safetestset "Tensor Product Layer" begin include("tensor_product_test.jl") end diff --git a/test/tensor_product_test.jl b/test/tensor_product_test.jl index 3aa3da748..a5b72d9ff 100644 --- a/test/tensor_product_test.jl +++ b/test/tensor_product_test.jl @@ -23,9 +23,11 @@ function run_test(f, layer, atol, N) optfunc = Optimization.OptimizationFunction((x, p) -> loss_function(x), Optimization.AutoZygote()) optprob = Optimization.OptimizationProblem(optfunc, ps) - res = Optimization.solve(optprob, OptimizationOptimisers.Adam(0.1); callback = cb, maxiters = 100) + res = Optimization.solve( + optprob, OptimizationOptimisers.Adam(0.1); callback = cb, maxiters = 100) optprob = Optimization.OptimizationProblem(optfunc, res.minimizer) - res = Optimization.solve(optprob, OptimizationOptimisers.Adam(0.01); callback = cb, maxiters = 100) + res = Optimization.solve( + optprob, OptimizationOptimisers.Adam(0.01); callback = cb, maxiters = 100) optprob = Optimization.OptimizationProblem(optfunc, res.minimizer) res = Optimization.solve(optprob, BFGS(); callback = cb, maxiters = 200) opt = res.minimizer