VAE classification

In a):

  • since you are already using poutine.mask you don’t need to mask the Categorical distribution with .mask
  • you don’t need pyro.sample in the guide for sample sites that are observed in the model, i.e. sequences site.

Before dealing with masking (it can be tricky) I would recommend going through pyro tutorials to get a good grasp of how pyro.sample works, how obs= keyword works, how model/guide pair should be structured, how pyro.sample is different from SomeDistribution.sample, etc.