SciML / DiffEqFlux.jl

Pre-built implicit layer architectures with O(1) backprop, GPUs, and stiff+non-stiff DE solvers, demonstrating scientific machine learning (SciML) and physics-informed machine learning methods
https://docs.sciml.ai/DiffEqFlux/stable
MIT License
865 stars 154 forks source link

Bugs in Neural ODE example in docs #846

Closed vleon1234 closed 1 year ago

vleon1234 commented 1 year ago

On a fresh install of julia 1.9.2, I Pkg add Lux, DiffEqFlux, DifferentialEquations, Optimization, OptimizationOptimJL, Random, Plots

Then, I try to run the copy pastable code in the example here: https://docs.sciml.ai/DiffEqFlux/stable/examples/neural_ode/

There are two errors that occur:

  1. Lux.ComponentArray(p) throws an error that ComponentArray doesn't exist. To fix, I did Pkg add ComponentArrays, and deleted Lux., so the working line is then: pinit = Lux.ComponentArray(p)
  2. Optimization.solve(..., ADAM(0.05),...) throws an error. To fix, I replaced ADAM(0.05) with Optimisers.ADAM(0.05).

After fixing these to bugs, the example ran for me. Not sure if this is best practices, but this is what worked for me.

ChrisRackauckas commented 1 year ago

Yeah these docs haven't built in awhile, and there's a few old things in there. It's one of the JuliaCon hackathon topics to revive these docs https://github.com/SciML/DiffEqFlux.jl/pull/848