Skip to content

Commit

Permalink
Update complex_matrix_finitediff.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Nov 18, 2024
1 parent aef3a2c commit d3d0c51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/complex_matrix_finitediff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ prob_ode = ODEProblem(f_nn, u0, tspan, ComponentArray(ip));

function loss_adjoint(p; sensealg = nothing)
local prediction = solve(
prob_ode, BS5(), p = p, abstol = 1e-12, reltol = 1e-12, sensealg = sensealg)
prob_ode, BS5(), p = p, abstol = 1e-13, reltol = 1e-13, sensealg = sensealg)
local usol = last(prediction)
local loss = abs(1.0 - abs(tr(usol * utarget') / 2))
return loss
Expand All @@ -35,5 +35,5 @@ dp3 = Zygote.gradient(
x, sensealg = InterpolatingAdjoint(autodiff = false, autojacvec = false)),
ComponentArray(ip))

@test dp1[1]dp2 atol=1e-3
@test dp1[1]dp3[1] atol=5e-3
@test dp1[1]dp2 atol=1e-2
@test dp1[1]dp3[1] atol=5e-2

0 comments on commit d3d0c51

Please sign in to comment.