Skip to content

Commit 799f7de

Browse files
Fix random tests
1 parent 1af0998 commit 799f7de

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

docs/pages.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pages = ["index.md",
77
"tutorials/linearandinteger.md",
88
"tutorials/minibatch.md",
99
"tutorials/remakecomposition.md",
10-
"tutorials/symbolic.md",
10+
"tutorials/symbolic.md"
1111
],
1212
"Examples" => [
1313
"examples/rosenbrock.md"
@@ -41,6 +41,6 @@ pages = ["index.md",
4141
"Polyalgorithms.jl" => "optimization_packages/polyopt.md",
4242
"PRIMA.jl" => "optimization_packages/prima.md",
4343
"QuadDIRECT.jl" => "optimization_packages/quaddirect.md",
44-
"SpeedMapping.jl" => "optimization_packages/speedmapping.md",
44+
"SpeedMapping.jl" => "optimization_packages/speedmapping.md"
4545
]
4646
]

docs/src/tutorials/minibatch.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,8 @@ function dudt_(u, p, t)
3232
smodel(u, p) .* u
3333
end
3434
35-
function callback(state, l, pred; doplot = false) #callback function to observe training
35+
function callback(state, l) #callback function to observe training
3636
display(l)
37-
# plot current prediction against data
38-
if doplot
39-
pl = scatter(t, ode_data[1, :], label = "data")
40-
scatter!(pl, t, pred[1, :], label = "prediction")
41-
display(plot(pl))
42-
end
4337
return false
4438
end
4539

lib/OptimizationNLopt/test/runtests.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ using Test, Random
117117
# @test sol.retcode == ReturnCode.Success
118118
@test 10 * sol.objective < l1
119119

120-
Random.seed!(1)
121-
prob = OptimizationProblem(optprob, rand(2), _p, lcons = [-Inf, -Inf],
120+
prob = OptimizationProblem(optprob, [0.5, 0.5], _p, lcons = [-Inf, -Inf],
122121
ucons = [0.0, 0.0], lb = [-1.0, -1.0], ub = [1.0, 1.0])
123122
sol = solve(prob, NLopt.GN_ISRES(), maxiters = 1000)
124123
@test sol.retcode == ReturnCode.MaxIters

test/diffeqfluxtests.jl

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using OrdinaryDiffEq, DiffEqFlux, Lux, Optimization, OptimizationOptimJL,
22
OptimizationOptimisers, ForwardDiff, ComponentArrays, Random
33
rng = Random.default_rng()
4+
Random.seed!(123)
45

56
function lotka_volterra!(du, u, p, t)
67
x, y = u

0 commit comments

Comments
 (0)