-
Notifications
You must be signed in to change notification settings - Fork 22
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
log1pmx
and logmxp1
cannot be differentiated by ForwardDiff
#44
Comments
This looks like it would make sense, given that the other functions dispatch on `Real` argument, and it also fixes JuliaStats#44.
I assume they are missing in DiffRules? |
#45 is sufficient to fix this. |
It will not use the optimized Float64 implementations though which would be used if rules are added in DiffRules. Hence for ForwardDiff support #45 is a bit suboptimal. |
Sure. However, the above tests pass, i.e. using In any case, when someone will have the time and capacity to do this, it will not conflict with the fallback in #45. So the ForwardDiff support is not conflicting with merging #45, is it? |
IMO the initial implementation does not have to be hyperoptimized. My point was that the computation of the primal will be suboptimal since it will use the generic fallback instead of the Float64 method. I did not want to refer to the computation of the derivative (even though possibly it can be optimized). The PR does not conflict with such DiffRules additions but in my opinion it's not the correct fix for this issue here, and hence the motivation is a bit different. Regardless of that, I think it is reasonable to extend them to |
I'm working on a PR to DiffRules.jl already. |
Will be released in DiffRules 1.11.0: JuliaRegistries/General#59302 |
* Add fallbacks for `log1pmx` and `logmxp1` This looks like it would make sense, given that the other functions dispatch on `Real` argument, and it also fixes #44. * Use less naive heuristic Co-authored-by: David Widmann <[email protected]> * Add some tests * Bump version Co-authored-by: David Widmann <[email protected]>
yields
The text was updated successfully, but these errors were encountered: