-
Notifications
You must be signed in to change notification settings - Fork 89
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
Derivatives of Bessel functions with respect to the order #208
Comments
Good question! I don't think we have a good answer to this right now. I think it'd be good to avoid this question arising for a bit longer, by not having the rules for SpecialFunctions.jl defined in ChainRules.jl, and instead have them defined in SpecialFunctions.jl (using ChainRulesCore.jl). Then it would be a question for SpecialFunctions.jl. But that doesn't answer your question given the status quo. Maybe @oxinabox has something in mind? Currently, we load rules for SpecialFunctions via Requires.jl's
Yep, that's right. There's more details in the |
Requires supports multiple requirements. However, I guess it might be problematic to override an existing default rule that just returns |
However, ideally I guess SpecialFunctions would have to depend on HypergeometricFunctions. It might be quite unintuitive and surprising for a user if the custom adjoints change after loading some package - and it might be quite tricky for a user to figure out that she has to load HypergeometricFunctions if she wants to compute the derivatives with respect to the order (although that could probably be resolved by a good documentation to some extent at least). |
hmm. I think the way forward here might be to just move the SpecialFunctions rules to SpecialFunctions.jl (then that package considers the merits of how best to implement derivatives e.g. whether or not to depend on HypergeometricFunctions). Now that ChainRules has users (via Zygote and ForwardDiff2), it might be a good time to raise that conversation over on the SpecialFunctions repo? |
I made a PR to the SpecialFunctions repo: JuliaMath/SpecialFunctions.jl#238 |
Should be transferred to SpecialFunctions (#319). |
Sadely can't do a tranfer across orgs |
In https://www.tandfonline.com/doi/pdf/10.1080/10652469.2016.1164156, closed-form expressions were derived for the derivatives of Bessel functions with respect to the order. Currently these are not implemented (they are defined as
NaN
). These derivatives are useful, e.g., when working with the Matern kernel (see JuliaGaussianProcesses/KernelFunctions.jl#116 (comment)).It feels a bit problematic that these expressions involve hypergeometric functions and hence probably would introduce a dependency on HypergeometricFunctions.jl. Before putting together any PRs, I would like to know what's the preferred way in ChainRules to deal with such dependencies that are only needed for computing the derivatives? I assume as well that maybe one should use the
@thunk
macro to avoid these rather lengthy calculations if one is not interested in the derivatives with respect to the order?The text was updated successfully, but these errors were encountered: