I am trying to run the tutorial code from 2019 of Differentiable-trebuchet, but got error in trying to find the gradient with ForwardDiff
(https://github.com/JuliaComputing/ODSC2019/blob/master/03-Differentiable-trebuchet-Zygote)
using Flux, Trebuchet
using Zygote: gradient, forwarddiff
t = TrebuchetState()
simulate(t)
visualise(t)
function shoot(wind, angle, weight)
Trebuchet.shoot((wind, Trebuchet.deg2rad(angle), weight))[2]
end
shoot(ps) = forwarddiff(p → shoot(p…), ps)
gradient(shoot, [0, 45, 200])
Error:
Cannot determine ordering of Dual tags ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, ForwardDiff.Dual{Nothing, Float64, 3}} and Nothing
This code, being published in 2019, my have been updated but I could not find it. Any help is much appreciated.