Closed jessebett closed 5 years ago
rand(1,1)'
works though. Hmm....
x1 = rand(1)'
nn(x1)
gives a Matrix instead of an Adjoint
, and so it's not the same type. DiffEq assumes that you're using the same array type.
nn = Chain(Dense(1,10,tanh),Dense(10,10,tanh),Dense(10,1),x->vec(x)')
works
You're right, that is where the issue is. Thanks @ChrisRackauckas
Here's a quick toy with 1D state and batch dimension.
I thought I could just create a single batch element by transposing a singleton array. However
LinearAlgebra.Adjoint
breaks the forward solve inneural_ode
:If I collect first it's fine:
This is surprising because
LinearAlgebra.Adjoint
plays well with normal solves: