CPD representation in pyro

I am working on a Bayesian network which is a mix of both discrete and bayesian nodes.

With the continuous variables, it is quite intuitive to use the distribution objects in pyro. For the discrete nodes, I want to represent the distribution as a CPT.

Is that something that can be easily done with pyro? My plan is to optimize the model parameters using something like EM, so would need to compute the marginal log likelihoods at each node.

Is Pyro also a good choice for such a problem? Sorry for the broad nature of this last statement.

You can represent discrete nodes directly with pyro.distributions.Categorical.

Is Pyro also a good choice for such a problem?

It’s hard to say without any detail. You might start by reading the tutorials on tensor shapes and enumeration and reviewing any relevant examples of models with discrete latent variables.

1 Like