Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "DiffEqParamEstim"
uuid = "1130ab10-4a5a-5621-a13d-e4788d82bd4c"
version = "2.3.0"
version = "2.4.0"
authors = ["Chris Rackauckas <accounts@chrisrackauckas.com>"]

[deps]
Expand All @@ -27,7 +27,7 @@ ForwardDiff = "0.10"
PenaltyFunctions = "0.1, 0.2, 0.3"
PreallocationTools = "0.2, 0.3, 0.4, 1.0"
RecursiveArrayTools = "1.0, 2.0, 3, 4"
SciMLBase = "1.69, 2"
SciMLBase = "2, 3"
SciMLSensitivity = "7"
Statistics = "1.10"
StatsAPI = "1.8.0"
Expand Down
4 changes: 2 additions & 2 deletions src/cost_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function (f::L2Loss)(sol::SciMLBase.AbstractSciMLSolution)
sumsq = 0.0

if weight === nothing
@inbounds for i in 1:length(sol)
@inbounds for i in 1:length(sol.t)
for j in 1:length(sol[i])
sumsq += (data[j, i] - sol[j, i])^2
end
Expand All @@ -108,7 +108,7 @@ function (f::L2Loss)(sol::SciMLBase.AbstractSciMLSolution)
end
end
else
@inbounds for i in 1:length(sol)
@inbounds for i in 1:length(sol.t)
if weight isa Real
for j in 1:length(sol[i])
sumsq = sumsq + ((data[j, i] - sol[j, i])^2) * weight
Expand Down
6 changes: 3 additions & 3 deletions src/multiple_shooting_objective.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct Merged_Solution{T1, T2, T3}
end

function multiple_shooting_objective(
prob::DiffEqBase.DEProblem, alg, loss,
prob::DiffEqBase.AbstractDEProblem, alg, loss,
adtype = SciMLBase.NoAD(),
regularization = nothing; priors = nothing,
discontinuity_weight = 1.0,
Expand Down Expand Up @@ -72,11 +72,11 @@ function multiple_shooting_objective(
for k in 2:K
if discontinuity_weight isa Real
loss_val += discontinuity_weight *
sum((sol[k][1] - sol[k - 1][end]) .^ 2)
sum((sol[k].u[1] - sol[k - 1].u[end]) .^ 2)
else
loss_val += sum(
discontinuity_weight .*
(sol[k][1] - sol[k - 1][end]) .^ 2
(sol[k].u[1] - sol[k - 1].u[end]) .^ 2
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/two_stage_method.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function construct_oop_cost_function(f, du, preview_est_sol, preview_est_deriv,
end

function two_stage_objective(
prob::DiffEqBase.DEProblem, tpoints, data,
prob::DiffEqBase.AbstractDEProblem, tpoints, data,
adtype = SciMLBase.NoAD();
kernel = EpanechnikovKernel()
)
Expand Down
Loading