tensorflow icon indicating copy to clipboard operation
tensorflow copied to clipboard

Feature request: directional distributions (like von Mises-Fisher)

Open rw opened this issue 9 years ago • 12 comments

Are there plans to implement directional statistical distributions? In particular, I'm looking to get a von Mises-Fisher distribution into contrib/distributions/python.

I'm beginning work on a VMF distribution myself, but as a new TF user my progress is likely to be slow.

(Note that scipy.stats implements a basic von Mises distribution.)

References: Wikipedia: Von Mises–Fisher distribution Arxiv: Directional Statistics in Machine Learning: a Brief Review

rw avatar Dec 07 '16 04:12 rw

@rw I've just recently needed to implement this distribution and have some code that is based on the contrib.distributions interface (now in the process of being moved into the core). I haven't implemented the sampling algorithm yet and I only handle the p=3 and p=4 cases, but if you haven't already solved this problem I'm willing to share my code. Once I've got things in good shape I was planning on contributing it to TF.

xodus7 avatar Jun 15 '17 05:06 xodus7

@xodus7 Good to hear! I didn't get around to implementing this.

rw avatar Jun 24 '17 09:06 rw

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

itsmeolivia avatar Feb 08 '18 00:02 itsmeolivia

@xodus7 I am interested in this feature as well. If your code is still available, can you please contact me using [email protected]?

alexpashevich avatar Apr 19 '18 15:04 alexpashevich

@alexpashevich I sent you and email with the code. I hope it's useful!

xodus7 avatar Apr 19 '18 23:04 xodus7

We are tracking this in TF probability. Would love a contribution to get the ball rolling, even if you don't have a sampler.

brianwa84 avatar Apr 20 '18 17:04 brianwa84

What would be helpful would be an implementation of the modified bessel function with a custom gradient function. This repo https://github.com/nicola-decao/s-vae/blob/master/hyperspherical_vae/ops/ive.py wraps scipy methods which isn't the right approach for a contribution here, but is in many ways better than my approach approximating using power series expansions for small and large concentration parameters. If someone has some guidance for the best method to get an implementation of the bessel function then I'd be willing to make a go at a generalized implementation that supports dimensions P > 4.

xodus7 avatar Apr 24 '18 04:04 xodus7

Please remove the assignee, as this issue is inviting external contributions. Otherwise, remove the contributions welcome label. Thank you.

tensorflowbutler avatar May 10 '18 01:05 tensorflowbutler

Please remove the assignee, as this issue is inviting external contributions. Otherwise, remove the contributions welcome label. Thank you.

tensorflowbutler avatar May 27 '18 03:05 tensorflowbutler

Please remove the assignee, as this issue is inviting external contributions. Otherwise, remove the contributions welcome label. Thank you.

tensorflowbutler avatar Jun 10 '18 18:06 tensorflowbutler

Please remove the assignee, as this issue is inviting external contributions. Otherwise, remove the contributions welcome label. Thank you.

tensorflowbutler avatar Jun 25 '18 19:06 tensorflowbutler

Please remove the assignee, as this issue is inviting external contributions. Otherwise, remove the contributions welcome label. Thank you.

tensorflowbutler avatar Jul 10 '18 18:07 tensorflowbutler