-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating ParameterEstimation Benchmarks #1160
Updating ParameterEstimation Benchmarks #1160
Conversation
…into ParameterEstimation
…123/SciMLBenchmarks.jl into ParameterEstimation
The build for ParameterEstimation and PINNErrorVsTime hasn't started on the CI since the last 10 hours |
@ChrisRackauckas in LotkaVolterraParameterEstimation.jmd I got the following error on running the code which seems to be related to the blackbox optim @btime res1 = solve(optprob, BBO_adaptive_de_rand_1_bin(), maxiters = 4e3)
Any fixes you might suggest for this?? |
|
Do you have the latest version of OptimizationBBO and Optimization? Can you try and make an MWE? |
Yes. I am using the latest version of OptimizationBBO and Optimization. Here's the code for the MWE: using ParameterizedFunctions, OrdinaryDiffEq, DiffEqParamEstim, Optimization, ForwardDiff
using OptimizationBBO, OptimizationNLopt, Plots, RecursiveArrayTools, BenchmarkTools
using ModelingToolkit: t_nounits as t, D_nounits as D
gr(fmt=:png)
loc_bounds = Tuple{Float64, Float64}[(0, 5), (0, 5), (0, 5), (0, 5)]
glo_bounds = Tuple{Float64, Float64}[(0, 10), (0, 10), (0, 10), (0, 10)]
loc_init = [1,0.5,3.5,1.5]
glo_init = [5,5,5,5]
@mtkmodel LotkaVolterraTest begin
@parameters begin
a = 1.5 # Growth rate of prey
b = 1.0 # Predation rate
c = 3.0 # Death rate of predators
d = 1.0 # Reproduction rate of predators
e = 0.0 # Additional parameter (if needed)
end
@variables begin
x(t) = 1.0 # Population of prey with initial condition
y(t) = 1.0 # Population of predators with initial condition
end
@equations begin
D(x) ~ a * x - b * x * y
D(y) ~ -c * y + d * x * y
end
end
@mtkbuild f = LotkaVolterraTest()
u0 = [1.0,1.0] #initial values
tspan = (0.0,10.0)
p = [1.5,1.0,3.0,1,0] #parameters used, these need to be estimated from the data
tspan = (0.0, 30.0) # sample of 3000 observations over the (0,30) timespan
prob = ODEProblem(f, u0, tspan,p)
tspan2 = (0.0, 3.0) # sample of 3000 observations over the (0,30) timespan
prob_short = ODEProblem(f, u0, tspan2,p)
dt = 30.0/3000
tf = 30.0
tinterval = 0:dt:tf
time_points = collect(tinterval)
h = 0.01
M = 300
tstart = 0.0
tstop = tstart + M * h
tinterval_short = 0:h:tstop
t_short = collect(tinterval_short)
#Generate Data
data_sol_short = solve(prob_short,Tsit5(),saveat=t_short,reltol=1e-9,abstol=1e-9)
data_short = convert(Array, data_sol_short)
data_sol = solve(prob,Tsit5(),saveat=time_points,reltol=1e-9,abstol=1e-9)
data = convert(Array, data_sol)
t_concrete = collect(0.0:dt:tf)
obj = build_loss_objective(prob,Vern9(),L2Loss(t_concrete,data),tstops=t_concrete,reltol=1e-9,abstol=1e-9)
optprob = OptimizationProblem(obj, glo_init, lb = first.(glo_bounds), ub = last.(glo_bounds))
@btime res1 = solve(optprob, BBO_adaptive_de_rand_1_bin(), maxiters = 4e3) The error:
|
All packages updated with the manifest resolved. |
The MWE code will probably now give the following error
|
Only one built? |
Actually, I modified the code for all the three and all three were building on the CI but since the past few runs and commits, I found that only one was building on the CI, for some reason |
@ChrisRackauckas All the errors here have been fixed and all the three algorithms have been built successfully. Can you please review ?? I think we are ready to merge this. |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Add any other context about the problem here.