Skip to content

Commit 06fd9e4

Browse files
committed
add test
1 parent c0b51f0 commit 06fd9e4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/OptimizationOptimisers/test/runtests.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,14 @@ using Test
1717
prob = OptimizationProblem(optprob, x0, _p)
1818
sol = solve(prob, Optimisers.ADAM(), maxiters = 1000, progress = false)
1919
@test 10 * sol.minimum < l1
20+
21+
x0 = 2*ones(ComplexF64, 2)
22+
_p = ones(2)
23+
sumfunc(x0, _p) = sum(abs2, (x0 - _p))
24+
l1 = sumfunc(x0, _p)
25+
26+
optprob = OptimizationFunction(sumfunc, Optimization.AutoZygote())
27+
prob = OptimizationProblem(optprob, x0,_p)
28+
sol = solve(prob, Optimisers.ADAM(), maxiters = 1000)
29+
@test 10 * sol.minimum < l1
2030
end

0 commit comments

Comments
 (0)