Conditional Probability Tables For Pyro.Sample


#1

Im running the tutorials from http://pyro.ai/examples/
Using Pyro version 0.1.2
Question: I see “pyro.sample” for various standard distributions. I these support for CPTs (Tables) that are defined by
the user ? and pyro.sample can extract samples directly from it. I could obviously define and do sampling manually, but I dont know how that would interact with the rest of pyro. Specificially, If I had one rand var generated from a cpt, and the others were from pyro.sample, how would that affect inference for say MCMC methods.


#2

Pyro does require that all stochastic functions appear inside pyro.sample statements. You should be able to implement conditional probability tables using pyro.distributions.Categorical(my_table, one_hot=False): http://docs.pyro.ai/primitive_dist.html#module-pyro.distributions.categorical


#3

Thank you for the prompt help @fritzo.