Skip to content

Commit 40d6e53

Browse files
committed
test: tweak tolerance and number of steps
1 parent 33d0a26 commit 40d6e53

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/lotka_volterra.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ prob = ODEProblem{true, SciMLBase.FullSpecialize}(sys, [], (0, 1.0), [])
6262

6363
model_true = structural_simplify(lotka_true())
6464
prob_true = ODEProblem{true, SciMLBase.FullSpecialize}(model_true, [], (0, 1.0), [])
65-
sol_ref = solve(prob_true, Rodas5P(), abstol = 1e-8, reltol = 1e-8)
65+
sol_ref = solve(prob_true, Rodas5P(), abstol = 1e-10, reltol = 1e-8)
6666

6767
x0 = default_values(sys)[nn.p]
6868

@@ -74,7 +74,7 @@ function loss(x, (prob, sol_ref, get_vars, get_refs, set_x))
7474
new_p = set_x(prob, x)
7575
new_prob = remake(prob, p = new_p, u0 = eltype(x).(prob.u0))
7676
ts = sol_ref.t
77-
new_sol = solve(new_prob, Rodas5P(), abstol = 1e-8, reltol = 1e-8, saveat = ts)
77+
new_sol = solve(new_prob, Rodas5P(), abstol = 1e-10, reltol = 1e-8, saveat = ts)
7878

7979
loss = zero(eltype(x))
8080

@@ -122,7 +122,7 @@ op = OptimizationProblem(of, x0, ps)
122122
# false
123123
# end
124124

125-
res = solve(op, Adam(), maxiters = 5000)#, callback = plot_cb)
125+
res = solve(op, Adam(), maxiters = 10000)#, callback = plot_cb)
126126

127127
@test res.objective < 1
128128

0 commit comments

Comments
 (0)