Giter Site home page Giter Site logo

Comments (7)

devmotion avatar devmotion commented on September 21, 2024 1

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.

simsurace avatar simsurace commented on September 21, 2024 1

I'm working on a PR to DiffRules.jl already.

from logexpfunctions.jl.

devmotion avatar devmotion commented on September 21, 2024 1

Will be released in DiffRules 1.11.0: JuliaRegistries/General#59302

from logexpfunctions.jl.

devmotion avatar devmotion commented on September 21, 2024

I assume they are missing in DiffRules?

from logexpfunctions.jl.

simsurace avatar simsurace commented on September 21, 2024

#45 is sufficient to fix this.

from logexpfunctions.jl.

devmotion avatar devmotion commented on September 21, 2024

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.

simsurace avatar simsurace commented on September 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.