# Neural ODE minibatch error with multi-dimension input condition

**URL:** https://discourse.julialang.org/t/neural-ode-minibatch-error-with-multi-dimension-input-condition/76121
**Category:** Machine Learning
**Tags:** machine-learning, differentialequation
**Created:** [February 9, 2022, 9:38pm UTC](https://discourse.julialang.org/t/neural-ode-minibatch-error-with-multi-dimension-input-condition/76121 "2022-02-09T21:38:30Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![lindblot](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@lindblot](https://discourse.julialang.org/u/lindblot)
#### Post date: [February 16, 2022, 8:54pm UTC](https://discourse.julialang.org/t/neural-ode-minibatch-error-with-multi-dimension-input-condition/76121/5 "2022-02-16T20:54:08Z")

</div>

Solved. I think there were two issues here. One was changing the pend function to

```julia
function pend(u)
	vcat([[0] [1]] * u, -(g/L) .* sin.([[1] [0]] * u))
end

```

and then the last error associated with that change was because I didn’t put the parameters in `Flux.params(p)`, like [https://discourse.julialang.org/t/zygote-error-only-reference-types-can-be-differentiated-with-params/38224](https://discourse.julialang.org/t/zygote-error-only-reference-types-can-be-differentiated-with-params/38224).

I think the true answer here is why the new array multiplication + vcat worked and the original `pend` function did not. @dhairyagandhi96 if you have the reasoning for that, I’ll mark it as the answer

---

_[View the full topic](https://discourse.julialang.org/t/neural-ode-minibatch-error-with-multi-dimension-input-condition/76121)._
