Enumeration in Bivariate von mises


I have (in collaboration with someone) implemented a bivariate Von Mises distribution that can be used in Pyro. It works great in all cases so far such as with pyro.plate etc., but now that I’m trying to use it in an altered version of model_1 from the HMM example I’m running into problems and I can see the issue is with the parallel Enumeration.

The problem occurs when calculating a parameter (normalizing constant) when initializing the distribution and I’m a bit puzzled. Is there somewhere I can see how Pyros enumeration interacts with distributions so I can solve this problem?

can you be more specific? as long as your distribution is fully and correctly implemented (correct expand method, can deal with arbitrary dimensions of value in log_prob, etc) everything should just work

Reiterating @martinjankowiak’s comment, I suspect you might have a bug in broadcasting and in handling tensors with multiple input dimensions. You might take a look at some of the tricks mentioned in the tensor shapes tutorial, particularly indexing with ellipsis x[..., 0] and using negative dimensions so as to count from the right.

Thanks Martinjankowiak and fritzo. That link helped alot, I think it’s been updated since I last looked at it.

I’m aware this was a very vague question, for which I apologize. But in case it can help someone, my issue was that I had used torch.reshape instead of torch.squeeze() and torch.unsqueeze() in appropriate places.