Giter VIP home page Giter VIP logo

Comments (3)

JamesYang007 avatar JamesYang007 commented on June 8, 2024

Hey, thanks for trying out my library!

So for reverse AD, we don't actually compute anything until we call autodiff on the final expression. When we write for example

Var<double> a, b{2};
a = 5. * b * b;

the result of 5. * b * b does not get computed and "stored" in a. The expression a = 5. * b * b returns a completely different object representing it. So a working example would be something like

Var<double> a, b{2};
auto expr = (a = 5. * b * b);
autodiff(expr); // now a and b contain derivative values

And I couldn't think of a good use-case where operator+= would shine from simply using operator=. Is there a use-case you had in mind?

For forward AD using ad::ForwardVar, I think it makes sense to overload these operators so I can add that feature.

For allowing floating point values with ad::Var, I think that's a fair point too, I'll get around adding that! For now, you have to use ad::constant(5.) in place of 5..

from fastad.

JamesYang007 avatar JamesYang007 commented on June 8, 2024

#84 literals can now be used to construct expressions without the need for user to explicitly write ad::constant

from fastad.

JamesYang007 avatar JamesYang007 commented on June 8, 2024

#86 includes support for convenience operators: operator+=, operator-=, operator*=., operator/= for reverse mode

from fastad.

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.