Lucas Morton

Results 43 comments of Lucas Morton

This issue has been solved in https://github.com/caseychu/spotify-backup. It shouldn't be to hard to port it here. I'll take a stab at a PR this weekend.

Edit: Thought this was under ModelingToolkit. Making a separate issue over there instead.

Now that [ModelingToolkit#151](https://github.com/SciML/RecursiveArrayTools.jl/pull/151) landed, the traceback is different but the problem persists. Instead of going into the `ZygoteRule` from `RecursiveArrayTools`, the indexing gets handled (incorrectly) by `Zygote` itself. ```julia julia>...

These may be relevant to the proposed fix: https://github.com/JuliaDiff/ChainRulesCore.jl/issues/239 and https://github.com/FluxML/Zygote.jl/issues/811

Yup. I also figured out the issue with @bgctw 's prototype: you need to explicitly use `Base.getindex` here: ```julia function ChainRulesCore.rrule(::typeof(getindex), VA::ODESolution, sym) ```

Looks like handling the observed variables is tricky b/c they implicitly depend on the equations that relate them to the solution array.

Here's a partial solution for the states, but not for the observed variables. The array construction is a bit of a kludge. ```julia using SciMLBase #B/c modelingtoolkit doesn't reexport issymbollike...

Ahh, that's probably right. I guess I also need a dummy `ODESolution` just to hang the derivatives for `sol.prob.p` on?

Here's a functioning prototype for the simpler case where a single timeslice is chosen as well: ```julia ZygoteRules.@adjoint function Base.getindex(VA::ODESolution, sym::Num,j::Int) function ODESolution_getindex_pullback(Δ) # convert symbol to index i =...

Right, it boils down to #1014 then?