Open ali-ramadhan opened 4 years ago
Mutating arrays --- as in, changing the values in an array? This is not supported by Zygote?
Supporting a number time may not be too hard. Do you know what is needed specifically? Do we need to support dual numbers for all parameters, or do we need to allow different types for every parameter individually (so that just one parameter can be a dual number while the rest are floats?)
We do for some reason restrict KPP.Parameters
to AbstractFloat
right now, not sure why:
Luckily though we currently support typing the boundary conditions and constants.
For both the ForwardEuler
and BackwardEuler
time-steppers we use the solution
to determine the type of rhs
:
Though, is set!(fld, 0)
an issue if fld
is an array of dual numbers?
Tried to auto-diff OceanTurb.jl with Zygote.jl but it doesn't support mutating arrays (it know how to auto-diff broadcasts but mutating arrays makes it much harder to auto-diff)
I think you could use ForwardDiff.jl with mutating arrays but I couldn't really try it as it requires OceanTurb.jl to use dual numbers instead of Float64 (and
OceanTurb.KPP
didn't seem to have a float type kwarg).