-
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
xexpx, xexpy #35
xexpx, xexpy #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Can you add and test ChainRules derivatives as well?
I added the ChainRules and addressed your comments @devmotion @tpapp . Care for another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said in the comments, I am fine with the branch structure as is, so it is up to you. For all other minor changes I agree with @devmotion's comments (marked them by a 👍).
Once this is done, this PR should be ready to merge. Thanks for doing it!
f0d3bea
to
3d3d9a6
Compare
I addressed the comments. Only thing I don't understand is the objection to using @tpapp I think you requested some changes but I can't find them (probably bc I force pushed). I would like to see a release once this is merged. Should I bump the version here (to 0.3.7)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only thing I don't understand is the objection to using Ω / x in the chain rule @devmotion . I'd rather argue it is worth doing this optimization also for xlogx, etc. (in another PR)
I guess maybe I didn't express myself clearly enough: I'm not against optimizing the forward and reverse mode rules but I think computing Ω / x
is the wrong thing to do here. Instead one should implement frule
and rrule
manually and reuse the result of exp(x)
and exp(y)
from the computation of the primal.
But I think it's fine to do that in a separate PR and use the unoptimized version initially.
Why? |
Because it is an unnecessary computation that you can avoid by just reusing |
I implemented the explicit I also bumped the version. Can we tag a release after merging? Care to take another look? @devmotion @tpapp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks good. I made some suggestions for how the code could be made more readable and simpler (in particular the CR derivatives), and how the tests could be extended.
a36c63e
to
959298c
Compare
Incorporated most of your comments (with minor modifications) @devmotion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR and for addressing all our comments 🙂
I think the PR is ready to be merged and released but I want to wait if @tpapp has any additional comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks again!
Adds functions
xexpx(x)
andxexpy(x, y)
, which computex * exp(x)
andx * exp(y)
, respectively, but taking the "correct" limit when the exponent is infinite.Close #15 .