Skip to content

Commit

Permalink
Fix random tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavdixit02 committed Sep 20, 2024
1 parent 1af0998 commit 799f7de
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pages = ["index.md",
"tutorials/linearandinteger.md",
"tutorials/minibatch.md",
"tutorials/remakecomposition.md",
"tutorials/symbolic.md",
"tutorials/symbolic.md"
],
"Examples" => [
"examples/rosenbrock.md"
Expand Down Expand Up @@ -41,6 +41,6 @@ pages = ["index.md",
"Polyalgorithms.jl" => "optimization_packages/polyopt.md",
"PRIMA.jl" => "optimization_packages/prima.md",
"QuadDIRECT.jl" => "optimization_packages/quaddirect.md",
"SpeedMapping.jl" => "optimization_packages/speedmapping.md",
"SpeedMapping.jl" => "optimization_packages/speedmapping.md"
]
]
8 changes: 1 addition & 7 deletions docs/src/tutorials/minibatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,8 @@ function dudt_(u, p, t)
smodel(u, p) .* u
end
function callback(state, l, pred; doplot = false) #callback function to observe training
function callback(state, l) #callback function to observe training
display(l)
# plot current prediction against data
if doplot
pl = scatter(t, ode_data[1, :], label = "data")
scatter!(pl, t, pred[1, :], label = "prediction")
display(plot(pl))
end
return false
end
Expand Down
3 changes: 1 addition & 2 deletions lib/OptimizationNLopt/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ using Test, Random
# @test sol.retcode == ReturnCode.Success
@test 10 * sol.objective < l1

Random.seed!(1)
prob = OptimizationProblem(optprob, rand(2), _p, lcons = [-Inf, -Inf],
prob = OptimizationProblem(optprob, [0.5, 0.5], _p, lcons = [-Inf, -Inf],
ucons = [0.0, 0.0], lb = [-1.0, -1.0], ub = [1.0, 1.0])
sol = solve(prob, NLopt.GN_ISRES(), maxiters = 1000)
@test sol.retcode == ReturnCode.MaxIters
Expand Down
1 change: 1 addition & 0 deletions test/diffeqfluxtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using OrdinaryDiffEq, DiffEqFlux, Lux, Optimization, OptimizationOptimJL,
OptimizationOptimisers, ForwardDiff, ComponentArrays, Random
rng = Random.default_rng()
Random.seed!(123)

function lotka_volterra!(du, u, p, t)
x, y = u
Expand Down

0 comments on commit 799f7de

Please sign in to comment.