Categorical with no one hot


#1

Hi,
Great package. Finally a nice PPL for PyTorch! Thanks!
My question is if it is enough for me to do this (following the Neural HMM code):

            pyro.sample("obs_x_%d" % t,
                        dist.categorical,
                        emission_probs_t,
                        log_pdf_mask=mini_batch_mask[:, t - 1:t],
                        obs=mini_batch[:, t - 1].unsqueeze(1),
                        one_hot=False)

or should I provide vs=something as well, as my observations are just indices of the classes, instead of one hots.


#2

Hi lifengjin,

It should work fine to pass one_hot=False without vs in Pyro 0.1. I believe that will give you LongTensors as samples.

Note that in Pyro master and in the future 0.2 we have split OneHotCategorical out of Categorical, so the one_hot=False will no longer be necessary.