#Best way to perform Automatic Differentiation on functions with parameters

1 messages · Page 1 of 1 (latest)

untold briar
#

Hmm, do you need to dispatch on the type?

#
using ReverseDiff
function f(x, a) 
  return sum(x .* a) 
end

x0 = rand(5)
a0 = rand(5)


ReverseDiff.gradient(z->f(z, a0), x0)