Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing logabsgamma rules #83

Closed
Moelf opened this issue May 4, 2022 · 7 comments
Closed

missing logabsgamma rules #83

Moelf opened this issue May 4, 2022 · 7 comments

Comments

@Moelf
Copy link
Contributor

Moelf commented May 4, 2022

JuliaStats/LogExpFunctions.jl#49

I can try to make a PR? is there any example of similar function?

@devmotion
Copy link
Member

I added a rule to #79, seems I forgot to add it in that PR.

@Moelf
Copy link
Contributor Author

Moelf commented May 5, 2022

Oh sweet, I will wait for it to merge then

@devmotion
Copy link
Member

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.

@Moelf
Copy link
Contributor Author

Moelf commented May 5, 2022

ehhh, can we make a new function that returns logabsgamma(x)[1] then?

@devmotion
Copy link
Member

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).

@devmotion
Copy link
Member

I opened a PR: JuliaDiff/ForwardDiff.jl#585

@devmotion
Copy link
Member

The PR is merged and part of ForwardDiff 0.10.30 which is available soon: JuliaRegistries/General#60502

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants