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

New versions of TFP cause NaN gradients for RelaxedBernoulli near p=0 and p=1 #34

Open
EiffL opened this issue Aug 4, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@EiffL
Copy link
Member

EiffL commented Aug 4, 2021

I couldn't reproduce one of the figures of the paper (from this notebook: https://github.com/DifferentiableUniverseInitiative/DHOD/blob/master/nb/Zheng2007_demo.ipynb), specifically the figure comparing gradients.

Turns out, it's due to the RelaxedBernoulli being quite sensitive near 0 and 1 in newer versions of TFP, I'm trying to pin down exactly what changed, but checked that with previous versions (0.9) we can get nice gradients even close to the edges: https://colab.research.google.com/drive/1xkXYtC3ER1z0r25fkUa2pwV_b7OlQBnP?usp=sharing

@EiffL EiffL added the bug Something isn't working label Aug 4, 2021
@EiffL EiffL self-assigned this Aug 4, 2021
@EiffL
Copy link
Member Author

EiffL commented Aug 4, 2021

I made a more clean-cut example:

@EiffL
Copy link
Member Author

EiffL commented Aug 4, 2021

couldn't really find an explanation, so opened an issue upstream tensorflow/probability#1393

@EiffL
Copy link
Member Author

EiffL commented Aug 4, 2021

This is partially fixed by #36 which introduces a fix to bypass the problematic sigmoid in tfp, but I'm keeping this issue open to remember to remove that fix when TFP will be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant