Open iliailmer opened 1 year ago
This boils down to a simple issue that observed variables currently do not have adjoints defined. This had a PR that went stale: https://github.com/SciML/SciMLBase.jl/pull/85. We should revive it, and given we need to finish https://github.com/SciML/SciMLBase.jl/pull/342 when Yingbo comes back, @YingboMa let's take a day to solve these two before continuing to other things.
@ChrisRackauckas @YingboMa Thank you! For now, using numeric indices solves the issue.
@iliailmer Could you give some more details for your workaround?
For now, using numeric indices solves the issue.
I think I have a similar use case. Thank you!
@BernhardAhrens sure, if states are [x1, x2]
and measured quantities are [x1, x2^2]
then I replace the line
data = [sol[v.rhs] for v in mq] # this is where the code fails
with
data = [sol[1] sol[2]^2]
https://github.com/SciML/SciMLBase.jl/pull/479 Handles a lot of cases, but sol[sym]
is still missing an overload.
I was trying to adapt this example from tutorials so that I can use a more customized data sample. For example, if I have states
x1, x2, x3
, I collect the following sample:then I am trying to use loss as
but I am getting
ArgumentError: invalid index: x1(t) of type Term{Real, Base.ImmutableDict{DataType, Any}}
at the lineWhat can be done to fix this?