# How to use multiple inputs in \`NeuralODE\` object?

**URL:** <https://discourse.julialang.org/t/how-to-use-multiple-inputs-in-neuralode-object/66955>\
**Category:** Machine Learning\
**Tags:** question\
**Created:** [August 25, 2021, 3:21am UTC](https://discourse.julialang.org/t/how-to-use-multiple-inputs-in-neuralode-object/66955 "2021-08-25T03:21:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DiracFermion1](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@DiracFermion1](https://discourse.julialang.org/u/DiracFermion1)\
**Post date:** [August 25, 2021, 3:21am UTC](https://discourse.julialang.org/t/how-to-use-multiple-inputs-in-neuralode-object/66955/1 "2021-08-25T03:21:30Z")

</div>

Hi, I am trying to use multiple inputs in `NeuralODE` object and wonder what is the best way to do this. Specifically, I have the following object:

```julia
n_ode = NeuralODE(dudt, tspan, Tsit5(), saveat=t, reltol=1e-7, abstol=1e-9)

```

where `dudt` is a neural network taking multiple inputs. According to [https://github.com/SciML/DiffEqFlux.jl/blob/master/src/neural\_de.jl#L64](https://github.com/SciML/DiffEqFlux.jl/blob/master/src/neural_de.jl#L64), it looks like I can only pass a single variable `x` to `NeuralODE` object, and second argument should be parameter `p`. So I wonder if it is possible to use multiple inputs in this case?

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:** [August 25, 2021, 5:13am UTC](https://discourse.julialang.org/t/how-to-use-multiple-inputs-in-neuralode-object/66955/2 "2021-08-25T05:13:41Z")

</div>

If your system is just a neural network, then columns define independent systems, so a matrix initial condition would be multiple inputs. The tutorial on MNIST showcases this.

---

<div class="post-metadata">

**Author:** ![DiracFermion1](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@DiracFermion1](https://discourse.julialang.org/u/DiracFermion1)\
**Post date:** [August 25, 2021, 1:43pm UTC](https://discourse.julialang.org/t/how-to-use-multiple-inputs-in-neuralode-object/66955/3 "2021-08-25T13:43:33Z")

</div>

oh sorry I did not make it clear. By saying multiple inputs, I meant “each data point has multiple inputs”, an example is this neural network structure: [https://machinelearningmastery.com/wp-content/uploads/2017/08/multiple\_inputs.png](https://machinelearningmastery.com/wp-content/uploads/2017/08/multiple_inputs.png), where we have two branches of inputs and one output. `NeuralODE ` does not seem to be able to accept more than one branch of inputs, so I am wondering whether there is a way to do so.

UPDATE: I figure out how to pass multiple inputs as a tuple, but it looks like trainable parameters are not correctly captured, as discussed here: [How to make parameters of function within Flux.Chain trainable?](https://discourse.julialang.org/t/how-to-make-parameters-of-function-within-flux-chain-trainable/66983), if you can take a look at this question, that would be great, thanks!
