kailaix / ADCME.jl

Automatic Differentiation Library for Computational and Mathematical Engineering
https://kailaix.github.io/ADCME.jl/latest/
MIT License
286 stars 57 forks source link

Link with DifferentialEquations.jl #38

Open ChrisRackauckas opened 4 years ago

ChrisRackauckas commented 4 years ago

You can easily link DifferentialEquations.jl in with this system by defining an adjoint rule on its concrete_solve to utilize the adjoint method. The documentation on that part is defined in:

https://docs.juliadiffeq.org/latest/analysis/sensitivity/

The differentiation rules are defined in:

https://github.com/JuliaDiffEq/DiffEqBase.jl/blob/master/src/solve.jl#L198-L226

so you only need to map those 10 or so lines to drop down to a concrete_solve adjoint pass and it'll work.