1
$\begingroup$

I've been working through some literature on ODEs and keep coming across the below pseudo-code expression and am having trouble interpreting it for use in the Wolfram Language. I feel like I've solved many initial value problems over the years with NDSolve, but now think I need some help from someone who works with ODEs in a more robust capacity to describe the differences.

The above is from here which states that h(t0) is the initial state of the system, G is the function that defines the system. t0 & t1 are the start and end times and Theta is the parameters. (Pytorch also has an implementation I've been looking at).

As I researched ways to understand the parameters, I kept coming up with pseudo-code examples using ODESolve. Should I be using a different MMA function? Maybe there is an option I'm not understanding? What's the most straightforward way to think about this pseudo-code example in Mathematica?

$\endgroup$
6
  • $\begingroup$ In MA $\theta$-parameters are embedded in $G$. That is the only difference. However, there are several things that come as options to NDSolve that can be regarded as parameters $\theta$: AccuracyGoal, PrecisionGoal and WhenEvent . $\endgroup$
    – yarchik
    Commented Mar 2, 2021 at 16:56
  • $\begingroup$ This is relevant to my previous comment mathematica.stackexchange.com/questions/23102/… $\endgroup$
    – yarchik
    Commented Mar 2, 2021 at 16:57
  • $\begingroup$ To expand on @yarchik: I think it's something like NDSolve[{h'[t] == G[h[t], t, theta], h[t0] == h0}, {t, t0, t1}, opts...], where h0 is ${\bf h}(t_0)$. The parameters theta have to be specified numerically and are updated after each NDSolve call, to minimize the loss function I suppose. But I'll leave that for folks who do machine learning to explain. $\endgroup$
    – Michael E2
    Commented Mar 2, 2021 at 17:15
  • 2
    $\begingroup$ There's also ParametricNDSolve, which explicitly separates out parameters $\theta$. $\endgroup$
    – Chris K
    Commented Mar 2, 2021 at 17:21
  • 1
    $\begingroup$ @ChrisK Good rec. It also has the option, Method -> {"ParametricSensitivity" -> "AdjointSensitivity"}, which might do what the paper describes. I have yet to find a discussion of "ParametricSensitivity", other than a few scattered examples. There is probably more than is shown in them, judging by the error messages I get if I use "ParametricSensitivity" -> Foo and "ParametricSensitivity" -> {1, 0} in Method option to ParametricNDSolve. Would you happen to know of more complete documentation of "ParametricSensitivity"? $\endgroup$
    – Michael E2
    Commented Mar 2, 2021 at 18:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.