Closed RJZS closed 1 year ago
What version?
You haven't defined a dispatch for ::AbstractVector
, function (l::LuxNeurLayer)(x::AbstractMatrix, ps, st::NamedTuple)
Easiest thing to do would be
function (l::LuxNeurLayer)(x::AbstractVector, ps, st::NamedTuple)
y = reshape(x, :, 1)
res, st = l(y, ps, st)
return vec(res), st
end
Perfect, thank you very much!
(For future reference, this was with Julia v1.7.2, DiffEqFlux v2.0.0 and Lux v0.4.53)
Hi, I'm trying to run a NeuralODE with a custom layer,
LuxNeurLayer
, I've defined in Lux. I'm receiving a MethodError when I runprob_neuralode(u0, p, st)
. The error is:The closest candidate suggested is
(::LuxNeurLayer)(::AbstractMatrix, ::Any, ::NamedTuple)
which is odd I think, as it suggests thatu0
is the issue (which is aVector{Float32}
as in the tutorial).Any help would be appreciated! The rest of the code is below.