ettoremessina / differential-equations

Differential equation solvers
MIT License
14 stars 9 forks source link

Used older ersion of julia and the libs #1

Open sehHeiden opened 1 year ago

sehHeiden commented 1 year ago

i have tried to get it working. But the code of added train-mlp-to-fit-func-with-n-odes.jl does not use current state of the libraries.

At least FastDense, FastChain and sciml_train do not exist anymore and flux uses another stile.

sehHeiden commented 1 year ago

I updated the nODE to:

function neural_ode(data_dim; saveat = dataset_in)
    fc = Chain(Dense(data_dim, 64, swish),
               Dense(64, 32, swish),
               Dense(32, data_dim))

    n_ode = NeuralODE(
            fc,
            (minimum(dataset_in), maximum(dataset_in)),
            Tsit5(),
            saveat = saveat,
            abstol = 1e-9, reltol = 1e-9)
end

But starting at the training I can't figure how to get it to work:

for _ in 1:10
    Flux.train!(loss, Flux.params(n_ode, n_ode.p), (dataset_in,), opt, cb=cb_train)
end

has some problem with the dimensions in the loss/prediction.