SciML / DiffEqNoiseProcess.jl

A library of noise processes for stochastic systems like stochastic differential equations (SDEs) and other systems that are present in scientific machine learning (SciML)
https://docs.sciml.ai/DiffEqNoiseProcess/stable/
Other
63 stars 29 forks source link

VirtualBrownianTree cannot be reversed because it has no save_everystep field #152

Closed linusheck closed 1 year ago

linusheck commented 1 year ago

Hi all! I can't differentiate a VirtualBrownianTree using the BacksolveAdjoint because:

noise = VirtualBrownianTree(0f0, 0f0)
reverse(noise)

yields

ERROR: type VirtualBrownianTree has no field save_everystep

BacksolveAdjoint calls this method here: https://github.com/SciML/SciMLSensitivity.jl/blob/834a4c70c45c6525d66d6fa7ee7c29837435e0f9/src/backsolve_adjoint.jl#L332

linusheck commented 1 year ago

My first intuition would be that save_everystep just doesn't apply to the VBT and shouldn't be set if the field doesn't exist. I will make a PR that also adds a reversal of the VBT to the tests

linusheck commented 1 year ago

Ok, this isn't the only problem, the VBT also doesn't really work with NoiseWrapper. Am I using it correctly? I'm just trying to differentiate something in combination with BacksolveAdjoint.

ChrisRackauckas commented 1 year ago

@frankschae have you looked into this use case?

linusheck commented 1 year ago

I sent frank a message on slack :)

linusheck commented 1 year ago

Thanks so much! I'll try it out today :)

linusheck commented 1 year ago

Issue is fixed :)