-
Notifications
You must be signed in to change notification settings - Fork 220
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
Fix and add more AD tests #625
Conversation
REQUIRE
Outdated
@@ -11,6 +11,7 @@ MacroTools | |||
StatsFuns 0.7.0 | |||
SpecialFunctions | |||
Bijectors | |||
FDM |
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.
Move the dependency on FDM
to test/REQUIRE
?
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.
Well, that's what I thought I did! Thanks for pointing this out.
Thanks, @mohamed82008. This PR looks good to me. Just one minor comment about dependency, see code review. |
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.
Looks good!
x = map(_->Float64(_), vi[nothing]) | ||
∇E = gradient_reverse(x, vi, ad_test_f) | ||
x = map(x->Float64(x), vi[nothing]) | ||
∇E = gradient_reverse(x, vi, ad_test_f)[2] |
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.
Is the [2]
on purpose?
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.
Yes, the first value seems to be negative the logp
, whereas the second is the gradient. This is defined here.
This PR extends #624 and adds another workaround for
binomlogpdf
andForwardDiff
. It also adds tests for these AD functions and fixes other broken AD tests.