NeuralODE Layer Strategy

You weren’t returning the array you were creating in pend.

function pend(u)
    θ = u[1]
    dθ = u[2]
    [dθ,-(g/L)*sin(θ)]
end

is fine. Then you probably want to do multiple shooting here.