Comments (7)
I suppose that defining a diffrule would require one to write an optimized version of the derivative as well, i.e. to calculate the analytical derivative, and try to find an optimal implementation.
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 ::Real
. My only concern is that the proposed implementation might not be sufficiently accurate for Float32
and Float16
for which we provide optimized implementations for other functions. It would be good to check that it is sufficiently accurate for these types, and in particular the numerically problematic inputs.
from logexpfunctions.jl.
I'm working on a PR to DiffRules.jl already.
from logexpfunctions.jl.
Will be released in DiffRules 1.11.0: JuliaRegistries/General#59302
from logexpfunctions.jl.
I assume they are missing in DiffRules?
from logexpfunctions.jl.
#45 is sufficient to fix this.
from logexpfunctions.jl.
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.
from logexpfunctions.jl.
Sure. However, the above tests pass, i.e. using ≈
there are no significant differences with Zygote. So #45 is an intermediate, if suboptimal fix. I suppose that defining a diffrule would require one to write an optimized version of the derivative as well, i.e. to calculate the analytical derivative, and try to find an optimal implementation.
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?
from logexpfunctions.jl.
Related Issues (20)
- logsumexp(::SVector) allocates HOT 5
- clarify ChainRulesCore.jl integration
- `log1pmx`and `logmxp1` are probably not optimized for `Float32` and `Float16`
- `logabsgamma` doesn't work with ForwardDiff HOT 2
- logsoftmax
- `logsumexp(f, x)` (and `logsumexp!(f, out, x)`) HOT 1
- Issue with `logsumexp` with ForwardDiff (and -Inf values) HOT 1
- logaddexp introduces NaNs for non-finite values HOT 1
- 1.9-beta4 Extension errors: HOT 2
- Error during loading of extension HOT 1
- `init` keyword for `logsumexp` and co HOT 2
- `logabssinh`
- Citation?
- Support for `Num` from `Symbolics.jl` HOT 1
- ` AbstractIrrational` does not play nice with CUDA HOT 11
- Some tests failing on macOS HOT 4
- xexpy(0, 1000) should be zero HOT 5
- Add logmeanexp
- Add "a" parameter to softplus
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logexpfunctions.jl.