Closed Moelf closed 2 years ago
I added a rule to https://github.com/JuliaDiff/DiffRules.jl/pull/79, seems I forgot to add it in that PR.
Oh sweet, I will wait for it to merge then
Oh wait, I don't think it's currently possible to define a rule with DiffRules for this function. AFAIK DiffRules only supports real-valued functions with n real-valued arguments but logabsgamma
returns a tuple of real values.
ehhh, can we make a new function that returns logabsgamma(x)[1]
then?
Maybe we could add first \circ logabsgamma
on more recent Julia versions since it's possible to dispatch on it there.
However, I am not sure if DiffRules and inparticular downstream packages can deal with rules where there's not a symbol as function name but an to-be-dispatched expression.
Probably the simpler solution is adding a definition of logabsgamma(::Dual)
to ForwardDiff (it already depends on SpecialFunctions). Alternatively, you could use a ChainRulesCore compatible AD system (a rule is defined for CR).
I opened a PR: https://github.com/JuliaDiff/ForwardDiff.jl/pull/585
The PR is merged and part of ForwardDiff 0.10.30 which is available soon: https://github.com/JuliaRegistries/General/pull/60502
https://github.com/JuliaStats/LogExpFunctions.jl/issues/49
I can try to make a PR? is there any example of similar function?