# Neural ODEs and ODE parameter estimation

**URL:** <https://discourse.julialang.org/t/neural-odes-and-ode-parameter-estimation/114950>\
**Category:** Machine Learning\
**Created:** [May 30, 2024, 5:18am UTC](https://discourse.julialang.org/t/neural-odes-and-ode-parameter-estimation/114950 "2024-05-30T05:18:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![usiam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/usiam/32/47120_2.png) [@usiam](https://discourse.julialang.org/u/usiam)\
**Post date:** [May 30, 2024, 5:18am UTC](https://discourse.julialang.org/t/neural-odes-and-ode-parameter-estimation/114950/1 "2024-05-30T05:18:13Z")

</div>

I’m trying to do some parameter estimation of parameters in a set of coupled (stiff) differential equations by using some limited data and found out about Julia’s ODE suite.

Looking through some of the examples, such as [Neural Ordinary Differential Equations · DiffEqFlux.jl](https://docs.sciml.ai/DiffEqFlux/stable/examples/neural_ode/), I kind of have a sense of what is going on but one thing I don’t understand here is:

In neural odes you have parameters for the nn, say theta, but how do you also optimize for the parameters of the ode say phi?

Any example or link would be greatly appreciated.

Additionally, if you have incomplete state data, how would you use neural ODE? If I have a set of ODE:

dx1/dt = f(x1, t)  
dx2/dt = f(x2, t)  
dx3/dt = f(x3, t)  
dx4/dt = f(x4, t)

And in my dataset I only have data about x1 and x2 how do I use a NODE paradigm?

Thanks.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 30, 2024, 8:29am UTC](https://discourse.julialang.org/t/neural-odes-and-ode-parameter-estimation/114950/2 "2024-05-30T08:29:52Z")

</div>

If you’re just looking for parameter estimation, then use the SciMLSensitivity docs which is just around sensitivity analysis and differentiation.

> **[Parameter Estimation of Ordinary Differential Equations · SciMLSensitivity.jl](https://docs.sciml.ai/SciMLSensitivity/dev/tutorials/parameter_estimation_ode/)**
>
> Documentation for SciMLSensitivity.jl.

---

<div class="post-metadata">

**Author:** ![usiam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/usiam/32/47120_2.png) [@usiam](https://discourse.julialang.org/u/usiam)\
**Post date:** [May 30, 2024, 3:32pm UTC](https://discourse.julialang.org/t/neural-odes-and-ode-parameter-estimation/114950/3 "2024-05-30T15:32:19Z")

</div>

I understand but I am looking for something more along the lines of [DiffEqFlux.jl – A Julia Library for Neural Differential Equations](https://julialang.org/blog/2019/01/fluxdiffeq/#lets_put_an_ode_into_a_neural_net_framework)

and more specifically:

```m
  Conv((2,2), 1=>16, relu),
  x -> maxpool(x, (2,2)),
  Conv((2,2), 16=>8, relu),
  x -> maxpool(x, (2,2)),
  x -> reshape(x, :, size(x, 4)),
  x -> solve(prob,Tsit5(),u0=x,saveat=0.1)[1,:],
  Dense(288, 10), softmax) |> gpu

```

In what situations would you say this method would be more relevant than just the example you linked to? Or is it a case of iterating over different methods and these two are examples of the different methods?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 30, 2024, 3:35pm UTC](https://discourse.julialang.org/t/neural-odes-and-ode-parameter-estimation/114950/4 "2024-05-30T15:35:10Z")

</div>

I don’t understand the question. DiffEqFlux is just a neural network architecture. It uses SciMLSensitivity to train the neural network architectures. If you just care about the training process, i.e. parameter estimation, then look at SciMLSensitivity.
