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

Add reverse dispatch for VBT #153

Merged
merged 1 commit into from
Jun 2, 2023
Merged

Conversation

frankschae
Copy link
Member

See #152

(In contrast to all other noise processes), we don't need to reverse the noise values for the VBT.

f = (u, p, t) -> 1.01u
g = (u, p, t) -> 0.11u
W = VirtualBrownianTree(-2.0, 0.0; tree_depth=6, tend=2.0)
dt = 1 / 2^8
prob1 = SDEProblem(f, g, 1.0, (0.0, 1.0), noise=W)
sol1 = solve(prob1, EM(), dt=dt, save_noise=true)
prob2 = SDEProblem(f, g, sol1(1.0), (1.0, 0.0), noise=W)
sol2 = solve(prob2, EM(), dt=dt, save_noise=true)
@test sol1.W.W  sol2.W.W
@test sol2.u  reverse(sol1.u) rtol = 0.01

So, I think

Base.reverse(W::VirtualBrownianTree) = W

should fix it. @glatteis can you try if this will fix the issue with BacksolveAdjoint and InterpolatingAdjoint before we merge it?

@ChrisRackauckas ChrisRackauckas merged commit cdb9dd2 into SciML:master Jun 2, 2023
18 of 19 checks passed
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.

None yet

2 participants