I'm new with Julia trying to run the example proposed at https://diffeqflux.sciml.ai/stable/examples/normalizing_flows/ to define and train a continuous normalizing flow using sciml_train.
I just copy/pasted the written code and gets the following error:
ERROR: MethodError: no method matching (::var"#5#7")(::Array{Float32,1}, ::Float32)
Does someone know why I get this error? Here is the code:
nn = Chain(Dense(1, 3, tanh), Dense(3, 1, tanh))
tspan = (0.0f0,10.0f0)
ffjord_test = FFJORD(nn,tspan, Tsit5())
data_train = Float32.(rand(Normal(6.0,0.7), 1, 100))
function loss_adjoint(θ)
logpx = ffjord_test(data_train,θ)[1]
loss = -mean(logpx)
end
res1 = DiffEqFlux.sciml_train(loss_adjoint, ffjord_test.p, ADAM(0.1), cb = cb, maxiters = 100)
res2 = DiffEqFlux.sciml_train(loss_adjoint, res1.minimizer, LBFGS(), allow_f_increases = false)
Thank you