From 534573905332d3c0291fe6f6edc2a66e04590116 Mon Sep 17 00:00:00 2001 From: dfridovi Date: Tue, 26 Nov 2024 08:57:29 -0600 Subject: [PATCH] fixing deps for ex --- examples/Project.toml | 4 ++++ test/runtests.jl | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/Project.toml b/examples/Project.toml index e4b4851..87c0b1d 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -1,6 +1,9 @@ [deps] BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e" +ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" FastDifferentiation = "eb9bf01b-bf85-4b60-bf87-ee5de06c00be" +FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41" +ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" LazySets = "b4f0291d-fe17-52bc-9479-3d1a343d9043" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -9,3 +12,4 @@ ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" TrajectoryGamesBase = "ac1ac542-73eb-4349-ae1b-660ab3609574" TrajectoryGamesExamples = "ff3fa34c-8d8f-519c-b5bc-31760c52507a" +Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" diff --git a/test/runtests.jl b/test/runtests.jl index 3c220f2..cde574b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -69,17 +69,14 @@ using FiniteDiff: FiniteDiff unconstrained_dimension = size(M, 1), constrained_dimension = length(b), parameter_dimension = size(M, 1), - compute_sensitivities = true + compute_sensitivities = true, ) function f(θ) sol = MCPSolver.solve(MCPSolver.InteriorPoint(), mcp, θ) - #@infiltrate sum(sol.x .^ 2) + sum(sol.y .^ 2) end - #@infiltrate - ∇_autodiff_reverse = only(Zygote.gradient(f, θ)) ∇_autodiff_forward = only(Zygote.gradient(θ -> Zygote.forwarddiff(f, θ), θ)) ∇_finitediff = FiniteDiff.finite_difference_gradient(f, θ)