Skip to content
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

Support for u0 initial guess function #133

Merged
merged 5 commits into from
Nov 6, 2023

Conversation

avik-pal
Copy link
Member

@avik-pal avik-pal commented Nov 4, 2023

Fixes #128

TODOs

@avik-pal
Copy link
Member Author

avik-pal commented Nov 4, 2023

I will fix the piracy once SciML/DiffEqBase.jl#959 is merged and released.

@avik-pal avik-pal force-pushed the ap/initial_guess branch 4 times, most recently from aa61f0b to 893d6b8 Compare November 4, 2023 14:13
@avik-pal
Copy link
Member Author

avik-pal commented Nov 4, 2023

I want to get this in before #131, since that one is major release.

__initial_state_from_prob(u0::AbstractArray, mesh) = [copy(vec(u0)) for _ in mesh]
function __initial_state_from_prob(u0::AbstractVector{<:AbstractVector}, _)
function __initial_guess(f::F, p::P, t::T) where {F, P, T}
if static_hasmethod(f, Tuple{P, T})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that in v1.10 this isn't needed, and it can be incorrect.

src/utils.jl Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Nov 5, 2023

Benchmark Results

master 4740b04... t[master]/t[4740b04...]
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = false) 2.81 ± 0.1 ms 2.76 ± 0.073 ms 1.02
Simple Pendulum/IIP/MultipleShooting(10, Tsit5; grid_coarsening = true) 5.23 ± 0.19 ms 5.08 ± 0.12 ms 1.03
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.0737 ± 0.0056 s 0.0742 ± 0.0059 s 0.993
Simple Pendulum/IIP/MultipleShooting(100, Tsit5; grid_coarsening = true) 0.258 ± 0.0088 s 0.253 ± 0.0091 s 1.02
Simple Pendulum/IIP/Shooting(Tsit5()) 0.251 ± 0.012 ms 0.244 ± 0.012 ms 1.03
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = false) 7.14 ± 0.28 ms 7.12 ± 0.74 ms 1
Simple Pendulum/OOP/MultipleShooting(10, Tsit5; grid_coarsening = true) 12.8 ± 7.1 ms 13 ± 8.1 ms 0.984
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = false) 0.195 ± 0.001 s 0.2 ± 0.0036 s 0.975
Simple Pendulum/OOP/MultipleShooting(100, Tsit5; grid_coarsening = true) 1.03 ± 0.018 s 1.03 ± 0.0088 s 1
Simple Pendulum/OOP/Shooting(Tsit5()) 1.03 ± 0.095 ms 1.02 ± 0.12 ms 1.01
time_to_load 9.13 ± 0.14 s 8.81 ± 0.27 s 1.04

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@ChrisRackauckas ChrisRackauckas merged commit 8e97e90 into SciML:master Nov 6, 2023
11 checks passed
@avik-pal avik-pal deleted the ap/initial_guess branch November 6, 2023 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Initial Guess Function
2 participants