# \#diffeqflux

**URL:** https://discourse.julialang.org/tag/diffeqflux/916.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Training Neural ODEs - Advice](https://discourse.julialang.org/t/training-neural-odes-advice/130141)

<div class="topic-metadata">

**Author:** [@julianewbsourcream](https://discourse.julialang.org/u/julianewbsourcream)\
**Replies:** 2\
**Last updated:** [June 24, 2025, 1:49pm UTC](https://discourse.julialang.org/t/training-neural-odes-advice/130141 "2025-06-24T13:49:26Z")

</div>

Hi, I am looking for some advice about training neural ODE models. I am looking to train a neural ODE model on a sample of ~25000, 10x4000 matrices. The columns represent time so I was looking to at use an increasing am…

---

## [Questions about the DiffEqFlux multiple shooting example](https://discourse.julialang.org/t/questions-about-the-diffeqflux-multiple-shooting-example/129418)

<div class="topic-metadata">

**Author:** [@julianewbsourcream](https://discourse.julialang.org/u/julianewbsourcream)\
**Replies:** 4\
**Last updated:** [June 2, 2025, 5:17pm UTC](https://discourse.julialang.org/t/questions-about-the-diffeqflux-multiple-shooting-example/129418 "2025-06-02T17:17:28Z")

</div>

Hi, I am training a neural ODE on a periodic function and wanted to try out DiffEqFlux.multiple\_shoot(). After reviewing the online example @ docs.sciml.ai/DiffEqFlux/stable/examples/multiple\_shooting/, I was hoping so…

---

## [Help training a NN that's used as a parameter in an ODE](https://discourse.julialang.org/t/help-training-a-nn-thats-used-as-a-parameter-in-an-ode/129231)

<div class="topic-metadata">

**Author:** [@alexl123](https://discourse.julialang.org/u/alexl123)\
**Replies:** 1\
**Last updated:** [May 22, 2025, 2:01am UTC](https://discourse.julialang.org/t/help-training-a-nn-thats-used-as-a-parameter-in-an-ode/129231 "2025-05-22T02:01:42Z")

</div>

Hello! I’ve been pulling my hair out trying to implement an ODE where one of the parameters is the output of a NN net. ChatGPT has me going in circles. Depending on what fixes I try I either get a: Error in epoch 1: Me…

---

## [LegendreBasis from DiffEqFlux is not present in current version?](https://discourse.julialang.org/t/legendrebasis-from-diffeqflux-is-not-present-in-current-version/123568)

<div class="topic-metadata">

**Author:** [@Luis\_Reig\_Quilis](https://discourse.julialang.org/u/Luis_Reig_Quilis)\
**Replies:** 3\
**Last updated:** [December 7, 2024, 5:51pm UTC](https://discourse.julialang.org/t/legendrebasis-from-diffeqflux-is-not-present-in-current-version/123568 "2024-12-07T17:51:41Z")

</div>

Good day, everyone. I am trying to follow this tutorial from DiffEqFlux. During the second step of the tutorial, we have to create a TensorLayer to perform 10th order expansions in a Legendre Basis using the following …

---

## [Trouble with CPU+GPU adjoints for UDEs](https://discourse.julialang.org/t/trouble-with-cpu-gpu-adjoints-for-udes/115290)

<div class="topic-metadata">

**Author:** [@19fitzna](https://discourse.julialang.org/u/19fitzna)\
**Replies:** 1\
**Last updated:** [June 6, 2024, 5:49pm UTC](https://discourse.julialang.org/t/trouble-with-cpu-gpu-adjoints-for-udes/115290 "2024-06-06T17:49:02Z")

</div>

Hi all! I am currently trying to create UDEs using a GPU backend for the neural network only. I have been following the examples here, but have not been able to get anything to work. I was wondering if anyone might know …

---

## [Incorporating structural information into Neural ODE as a Differential Equation System](https://discourse.julialang.org/t/incorporating-structural-information-into-neural-ode-as-a-differential-equation-system/113968)

<div class="topic-metadata">

**Author:** [@CurioMath](https://discourse.julialang.org/u/CurioMath)\
**Replies:** 0\
**Last updated:** [May 7, 2024, 7:48pm UTC](https://discourse.julialang.org/t/incorporating-structural-information-into-neural-ode-as-a-differential-equation-system/113968 "2024-05-07T19:48:21Z")

</div>

Can I know if we can feed the known physics information about a system, as a Differential Equation System into Neural network architecture within NeuralODE in DiffEqFlux.jl? I have referred documentation examples, but f…

---

## [ODEProblem(....) vs NeuralODE(....) for neural ODEs](https://discourse.julialang.org/t/odeproblem-vs-neuralode-for-neural-odes/112670)

<div class="topic-metadata">

**Author:** [@KianH](https://discourse.julialang.org/u/KianH)\
**Replies:** 14\
**Last updated:** [April 15, 2024, 2:16pm UTC](https://discourse.julialang.org/t/odeproblem-vs-neuralode-for-neural-odes/112670 "2024-04-15T14:16:22Z")

</div>

Hello! I am wondering about the difference when using ODEProblem(....) from DifferentialEquations.jl and NeuralODE(....) from DiffEqFlux.jl in terms of time performance. Consider the code below, thus, definining the …

---

## [Control of an ODE using neural network](https://discourse.julialang.org/t/control-of-an-ode-using-neural-network/101206)

<div class="topic-metadata">

**Author:** [@SanAlphaTau](https://discourse.julialang.org/u/SanAlphaTau)\
**Replies:** 3\
**Last updated:** [September 29, 2023, 12:33pm UTC](https://discourse.julialang.org/t/control-of-an-ode-using-neural-network/101206 "2023-09-29T12:33:33Z")

</div>

I recall previous diffeqflux.jl docs having an example of how to train a neural network as a control of a ODE. Essentially subbing the control term for a neural network call. https://docs.juliahub.com/DiffEqFlux/BdO4p/1…

---

## [Instabilities on a simple dataset when training a NODE on it](https://discourse.julialang.org/t/instabilities-on-a-simple-dataset-when-training-a-node-on-it/103916)

<div class="topic-metadata">

**Author:** [@jarroyoe](https://discourse.julialang.org/u/jarroyoe)\
**Replies:** 5\
**Last updated:** [September 20, 2023, 4:50pm UTC](https://discourse.julialang.org/t/instabilities-on-a-simple-dataset-when-training-a-node-on-it/103916 "2023-09-20T16:50:28Z")

</div>

I have an extremely simple dataset that for some reason keeps outputing instabilities when trying to train a NODE algorithm on it, no matter how low the tolerance is set or what solver I choose. I train it twice, once wi…

---

## [Tips for improving performance of NODEs with sparsely sampled time series?](https://discourse.julialang.org/t/tips-for-improving-performance-of-nodes-with-sparsely-sampled-time-series/103828)

<div class="topic-metadata">

**Author:** [@jarroyoe](https://discourse.julialang.org/u/jarroyoe)\
**Replies:** 1\
**Last updated:** [September 13, 2023, 8:46pm UTC](https://discourse.julialang.org/t/tips-for-improving-performance-of-nodes-with-sparsely-sampled-time-series/103828 "2023-09-13T20:46:41Z")

</div>

I have a synthetic time series coming from a model with a daily time scale. The real dynamics closely follow a sine function, but I’m trying to sample at a monthly time scale (every 30 time steps). A sample time series l…

---

## [Log automatic selection of sensitivity algorithm](https://discourse.julialang.org/t/log-automatic-selection-of-sensitivity-algorithm/100691)

<div class="topic-metadata">

**Author:** [@nina](https://discourse.julialang.org/u/nina)\
**Replies:** 1\
**Last updated:** [June 22, 2023, 9:48pm UTC](https://discourse.julialang.org/t/log-automatic-selection-of-sensitivity-algorithm/100691 "2023-06-22T21:48:19Z")

</div>

Dear all, I am training a universal differential equation with Zygote without specifying what sensitivity algorithm I am using. Hence, according to the SciMLSensitivity Docs a “smart polyalgorithm is used to automatical…

---

## [Running neural ODE on measurement](https://discourse.julialang.org/t/running-neural-ode-on-measurement/100179)

<div class="topic-metadata">

**Author:** [@Ordens\_Ritter](https://discourse.julialang.org/u/Ordens_Ritter)\
**Replies:** 7\
**Last updated:** [June 13, 2023, 6:33am UTC](https://discourse.julialang.org/t/running-neural-ode-on-measurement/100179 "2023-06-13T06:33:43Z")

</div>

I am trying get a neural ODE working, that doesn’t have a function/ode as input but a measurement. I want to apply the neural ODE to get the original function expressed by the measurement and not the derivative. I am t…

---

## [GPU specifications -- what's the best GPU choice for diffeqGPUs?](https://discourse.julialang.org/t/gpu-specifications-whats-the-best-gpu-choice-for-diffeqgpus/99945)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 9\
**Last updated:** [June 7, 2023, 5:24pm UTC](https://discourse.julialang.org/t/gpu-specifications-whats-the-best-gpu-choice-for-diffeqgpus/99945 "2023-06-07T17:24:58Z")

</div>

I’m looking out specifying a cluster for our IT guys. I’m not a GPU guru and am not up to date on all of the choices. I see there are a lot of options and some GPUs are more optimized for machine learning, etc. I’d li…

---

## [DiffEqFlux throws a CUDA error on installation](https://discourse.julialang.org/t/diffeqflux-throws-a-cuda-error-on-installation/99212)

<div class="topic-metadata">

**Author:** [@Vidianos](https://discourse.julialang.org/u/Vidianos)\
**Replies:** 6\
**Last updated:** [May 22, 2023, 6:52pm UTC](https://discourse.julialang.org/t/diffeqflux-throws-a-cuda-error-on-installation/99212 "2023-05-22T18:52:18Z")

</div>

Hello, I am trying to get into the SciML ecosystem and as such I installed DiffEqFlux. During installation, I get this error Blockquote DiffEqFlux \[aae7a2af-3d4f-5e19-a356-7da93b79d9d0\] │ ┌ Error: Failed to initial…

---

## [Not all parameters being estimated in DiffEqFlux](https://discourse.julialang.org/t/not-all-parameters-being-estimated-in-diffeqflux/98891)

<div class="topic-metadata">

**Author:** [@ANasc](https://discourse.julialang.org/u/ANasc)\
**Replies:** 5\
**Last updated:** [May 17, 2023, 3:02pm UTC](https://discourse.julialang.org/t/not-all-parameters-being-estimated-in-diffeqflux/98891 "2023-05-17T15:02:00Z")

</div>

I’m trying to fit a simple Von Bertalanffy curve to some data using DiffEqFlux but one of the parameters (init\_p\[3\]) does not change with each iteration. I suspect it might have something to do with the step function ins…

---

## [Parameter estimation DefaultOptimizationCache not defined (DiffEqFlux)](https://discourse.julialang.org/t/parameter-estimation-defaultoptimizationcache-not-defined-diffeqflux/98635)

<div class="topic-metadata">

**Author:** [@ANasc](https://discourse.julialang.org/u/ANasc)\
**Replies:** 5\
**Last updated:** [May 15, 2023, 2:25pm UTC](https://discourse.julialang.org/t/parameter-estimation-defaultoptimizationcache-not-defined-diffeqflux/98635 "2023-05-15T14:25:58Z")

</div>

Hi, I’m trying to learn the basics of parameter estimation with DiffEqFlux by adapting the first example from here https://docs.juliahub.com/DiffEqFlux/BdO4p/1.9.0/ to my own problem. However, I keep getting the followi…

---

## [Flux Restructure for ComponentArrays.jl unreasonably slow](https://discourse.julialang.org/t/flux-restructure-for-componentarrays-jl-unreasonably-slow/97849)

<div class="topic-metadata">

**Author:** [@glatteis](https://discourse.julialang.org/u/glatteis)\
**Replies:** 2\
**Last updated:** [April 24, 2023, 12:56pm UTC](https://discourse.julialang.org/t/flux-restructure-for-componentarrays-jl-unreasonably-slow/97849 "2023-04-24T12:56:18Z")

</div>

In some situations, you have to restructure a lot if you use Flux and want to run your batches as seperate solves, not as one big solve, for instance using an EnsembleProblem. You have to use something like a ComponentAr…

---

## [Minibatching neural ODEs with different initial conditions](https://discourse.julialang.org/t/minibatching-neural-odes-with-different-initial-conditions/96361)

<div class="topic-metadata">

**Author:** [@kaido975](https://discourse.julialang.org/u/kaido975)\
**Replies:** 7\
**Last updated:** [March 21, 2023, 8:18pm UTC](https://discourse.julialang.org/t/minibatching-neural-odes-with-different-initial-conditions/96361 "2023-03-21T20:18:39Z")

</div>

I am trying to train a neural ODE on different time trajectories, starting with different initial conditions. I am able to observe a reduction in loss with ADAM (with good outputs), but BFGS does not work at all. Why is …

---

## [Error loading model parameters with BSON](https://discourse.julialang.org/t/error-loading-model-parameters-with-bson/96136)

<div class="topic-metadata">

**Author:** [@JuliaQ123](https://discourse.julialang.org/u/JuliaQ123)\
**Replies:** 1\
**Last updated:** [March 17, 2023, 8:17am UTC](https://discourse.julialang.org/t/error-loading-model-parameters-with-bson/96136 "2023-03-17T08:17:36Z")

</div>

I’m running into an error when trying to load saved model parameters using BSON. I am saving the model parameters with @save model\_path model\_params\_save and then trying to load them as per the examples with @load mod…

---

## [Training a neural ode with unknow time span](https://discourse.julialang.org/t/training-a-neural-ode-with-unknow-time-span/95992)

<div class="topic-metadata">

**Author:** [@kaido975](https://discourse.julialang.org/u/kaido975)\
**Replies:** 4\
**Last updated:** [March 13, 2023, 2:48pm UTC](https://discourse.julialang.org/t/training-a-neural-ode-with-unknow-time-span/95992 "2023-03-13T14:48:03Z")

</div>

I am trying to train a neural ode with a start time = 0 and an unknown end time. Here is the working code. using Lux, DiffEqFlux, DifferentialEquations, Optimization, OptimizationOptimJL, Random, Plots, ComponentArrays…

---

## [Is the choice of integrator significant for NeuralODE solving?](https://discourse.julialang.org/t/is-the-choice-of-integrator-significant-for-neuralode-solving/95645)

<div class="topic-metadata">

**Author:** [@srikumarks](https://discourse.julialang.org/u/srikumarks)\
**Replies:** 1\
**Last updated:** [March 8, 2023, 1:49pm UTC](https://discourse.julialang.org/t/is-the-choice-of-integrator-significant-for-neuralode-solving/95645 "2023-03-08T13:49:43Z")

</div>

For directly solving known ODEs, of course the choice of integrator is significant. However, when learning a network that’s part of an ODE, it isn’t clear to me whether the integrator matters, or should matter. Does it …

---

## [PolyOpt() Functionality](https://discourse.julialang.org/t/polyopt-functionality/95734)

<div class="topic-metadata">

**Author:** [@JuliaQ123](https://discourse.julialang.org/u/JuliaQ123)\
**Replies:** 1\
**Last updated:** [March 8, 2023, 1:48pm UTC](https://discourse.julialang.org/t/polyopt-functionality/95734 "2023-03-08T13:48:07Z")

</div>

Hi, I have been setting up a universal differential equation model with multiple shooting, following the example, and it works great. I am just confused as to what the OptimizationPolyalgorithms.PolyOpt() optimizer is a…

---

## [Struggling to train a UDE with DiffEqGPU](https://discourse.julialang.org/t/struggling-to-train-a-ude-with-diffeqgpu/94938)

<div class="topic-metadata">

**Author:** [@JuliaQ123](https://discourse.julialang.org/u/JuliaQ123)\
**Replies:** 9\
**Last updated:** [March 7, 2023, 10:29pm UTC](https://discourse.julialang.org/t/struggling-to-train-a-ude-with-diffeqgpu/94938 "2023-03-07T22:29:59Z")

</div>

Hi, I’ve been trying to train a UDE model on a set of time series in parallel using DiffEqGPU and EnsembleProblem, with different stored u0 and p values. The goal is to compute the losses simultaneously for each batch, …

---

## [Dropout in UDEs using SciML and Lux](https://discourse.julialang.org/t/dropout-in-udes-using-sciml-and-lux/94960)

<div class="topic-metadata">

**Author:** [@nina](https://discourse.julialang.org/u/nina)\
**Replies:** 6\
**Last updated:** [February 22, 2023, 5:32pm UTC](https://discourse.julialang.org/t/dropout-in-udes-using-sciml-and-lux/94960 "2023-02-22T17:32:49Z")

</div>

Dear all, I am trying to use a Dropout layer in the NN component of a UDE for parameter estimation. It does work if I use a setup based on Flux. However, if I switch to Lux I get an error message too long to be displaye…

---

## [Struggling to train a UDE model with a GPU](https://discourse.julialang.org/t/struggling-to-train-a-ude-model-with-a-gpu/94565)

<div class="topic-metadata">

**Author:** [@JuliaQ123](https://discourse.julialang.org/u/JuliaQ123)\
**Replies:** 3\
**Last updated:** [February 14, 2023, 12:33pm UTC](https://discourse.julialang.org/t/struggling-to-train-a-ude-model-with-a-gpu/94565 "2023-02-14T12:33:09Z")

</div>

Hi I have been trying to implement a UDE model and train it using a GPU, following the Neural ODE docs closely. However when I run the code I get an extremely long error and I cannot figure out how to go about solving i…

---

## [How to estimate likelihood functions with normalizing flows in Julia](https://discourse.julialang.org/t/how-to-estimate-likelihood-functions-with-normalizing-flows-in-julia/92414)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 7\
**Last updated:** [January 3, 2023, 11:03am UTC](https://discourse.julialang.org/t/how-to-estimate-likelihood-functions-with-normalizing-flows-in-julia/92414 "2023-01-03T11:03:17Z")

</div>

Hi- I am interested in using normalizing flows in Julia to approximate intractable likelihood functions. The basic idea is to train a neural network to learn the relationship between parameters and samples from a model.…

---

## [Why doesn't this normalizing flow example work?](https://discourse.julialang.org/t/why-doesnt-this-normalizing-flow-example-work/92279)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 2\
**Last updated:** [December 29, 2022, 5:53pm UTC](https://discourse.julialang.org/t/why-doesnt-this-normalizing-flow-example-work/92279 "2022-12-29T17:53:26Z")

</div>

Hi- I am interested in using normalizing flows to approximate intractable likelihood functions. I found the following example using DiffEqFlux.jl: Continuous Normalizing Flows · DiffEqFlux.jl Given that this is such a …

---

## [Minibatching with FFJORD](https://discourse.julialang.org/t/minibatching-with-ffjord/92210)

<div class="topic-metadata">

**Author:** [@kaido975](https://discourse.julialang.org/u/kaido975)\
**Replies:** 1\
**Last updated:** [December 28, 2022, 1:35pm UTC](https://discourse.julialang.org/t/minibatching-with-ffjord/92210 "2022-12-28T13:35:50Z")

</div>

I am trying to implement the code given in Continuous Normalizing Flows · DiffEqFlux.jl, with mini batching. using Flux, DiffEqFlux, DifferentialEquations, Optimization, OptimizationFlux, OptimizationOptimJL, Dist…

---

## [Custom layer for a good guess of system dynamics](https://discourse.julialang.org/t/custom-layer-for-a-good-guess-of-system-dynamics/88728)

<div class="topic-metadata">

**Author:** [@Antonino\_Gandolfo](https://discourse.julialang.org/u/Antonino_Gandolfo)\
**Replies:** 9\
**Last updated:** [October 22, 2022, 4:25pm UTC](https://discourse.julialang.org/t/custom-layer-for-a-good-guess-of-system-dynamics/88728 "2022-10-22T16:25:09Z")

</div>

Hi, I’m trying to create a NeuralODE for the forcasting of a dynamic system. I did a NN for the forcasting of the system under different initial conditions and it’s work very well. Now I would like to create NN capable…

---

## [ODE parameter estimation using neural nets](https://discourse.julialang.org/t/ode-parameter-estimation-using-neural-nets/87458)

<div class="topic-metadata">

**Author:** [@RuoyuWang72](https://discourse.julialang.org/u/RuoyuWang72)\
**Replies:** 5\
**Last updated:** [September 21, 2022, 6:54am UTC](https://discourse.julialang.org/t/ode-parameter-estimation-using-neural-nets/87458 "2022-09-21T06:54:43Z")

</div>

I’m trying to add inequality constraints to my ODE parameter optimization problem. The example I followed was fluxdiffeq. I need p\[1\] + p\[2\] \<= 1 and p\[1\] and p\[2\] both also have to be positive. Is there any way I can ac…

[Next page](https://discourse.julialang.org/tag/diffeqflux/916.md?match_all_tags=true&page=1&tags%5B%5D=diffeqflux)
