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

Update the design of weight sampling in the BNN layers. #174

Open
dusenberrymw opened this issue Jan 27, 2020 · 0 comments
Open

Update the design of weight sampling in the BNN layers. #174

dusenberrymw opened this issue Jan 27, 2020 · 0 comments

Comments

@dusenberrymw
Copy link
Member

dusenberrymw commented Jan 27, 2020

TFP has been updated such that tfp.distributions.* objects can be initialized in a tape-safe manner. I.e., it's now possible to create a distribution within one tape, and use it in another tape. This test now would no longer fail even if we didn't create new weight RVs on each call.

However, we still need to be able to sample new values for the weights (also noted in eb4f33c), and be able to override this with tracers to enforce, for example, the use of the mean.

One option is to check if the layer weights are ed.RandomVariables, and if so, call .sample() within the layer (and regularizers) as needed. Tracers could be updated to override .sample() to return the mean if desired.

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

No branches or pull requests

1 participant