Zygote error. "Only reference types can be differentiated with `Params`."

The Flux API can be a bit difficult to use because of the globals which is why we recommend a sciml_train workflow these days, as demonstrated in the README: https://github.com/SciML/DiffEqFlux.jl