Skip to content
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 issue with adjoint sensitivities for domains where rate coefficients vary #95

Merged
merged 2 commits into from
Sep 12, 2020

Conversation

mjohnson541
Copy link
Collaborator

So I'm no longer able to reproduce the issue I had originally where using ReverseDiffVJP(false) gave NaNs forcing us to use ReverseDiffVJP(true) (which assumes no programmatic branching in the code, which should be true for domains with constant rate coefficients, but often not true for other domains) see #84 . I'm not entirely sure if this is something we fixed internally while working on something separate or it's related to package versioning. If the issue does up later we should be able to resolve it by adjusting our compat requirements. This PR switches us to default ReverseDiffVJP(false) and adds a test for adjoint and forward sensitivities for the ConstantVDomain.

ReverseDiffVJP(true) assumed there was no programmatic branching in the function
This is true for most simulations when the rate coefficients are constant, but the assumption breaks down when the rate coefficients aren't constant
Originally ReverseDiffVJP(false) gave NaNs when run and TrackerVJP() would crash (as it does currently) and so ReverseDiffVJP(true) was set as the default
This should resolve issues with inconsistency between forward sensitivities and adjoint sensitivities
Copy link
Contributor

@hwpang hwpang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants