brendanhasz / probflow

A Python package for building Bayesian models with TensorFlow or PyTorch
http://probflow.readthedocs.io
MIT License
170 stars 17 forks source link

Add flipout support for PyTorch #34

Closed brendanhasz closed 3 years ago

brendanhasz commented 3 years ago

Just need to implement two new ops: randn and rademacher, then use them to implement flipout in a backend-independent way in Dense. Can implement rademacher for pytorch via 2*torch.randint(0, 1, size)-1.

Also, in the TF implementation, update tfp.python.math.random_rademacher (which is deprecated) to tfp.random.rademacher.