-
-
Notifications
You must be signed in to change notification settings - Fork 161
multiple_shoot for EnsembleProblem
#602
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
Conversation
src/multiple_shooting.jl
Outdated
| loss_function::Function, | ||
| continuity_loss::Function, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stops specialization BTW
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the type specification ::Function. Is that what you had in mind?
| function multiple_shoot( | ||
| p::AbstractArray, | ||
| ode_data::AbstractArray, | ||
| tsteps::AbstractArray, | ||
| ensembleprob::EnsembleProblem, | ||
| ensemblealg::SciMLBase.BasicEnsembleAlgorithm, | ||
| loss_function::Function, | ||
| solver::DiffEqBase.AbstractODEAlgorithm, | ||
| group_size::Integer; | ||
| continuity_term::Real=100, | ||
| kwargs... | ||
| ) | ||
| # Continuity loss between last state in previous prediction | ||
| # and current initial condition in ode_data | ||
| function continuity_loss(û_end, u_0) | ||
| return sum(abs, û_end - u_0) | ||
| end | ||
|
|
||
| return multiple_shoot( | ||
| p, | ||
| ode_data, | ||
| tsteps, | ||
| ensembleprob, | ||
| ensemblealg, | ||
| loss_function, | ||
| continuity_loss, | ||
| solver, | ||
| group_size; | ||
| continuity_term, | ||
| kwargs... | ||
| ) | ||
|
|
||
| end | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should really move the optional argument to last
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what you mean by that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the reason for this dispatch is to handle the optional argument, but it really shouldn't be one of the ones in the middle then.
Hi,
This PR overloads the
multiple_shootfunction, so that it can be called with problems of typeEnsembleProblem.This is quite useful 😀
It is a suggestion for issue #601.