Hello, any tips/best practices on how to implement a hierarchical VAE with conditioning structure similar to this paper?

I’m confused about how to best implement the typical pyro *model/guide* setup since the prior/posterior is coupled at each level of the hierarchy, and the same top-down dependency structure is used in the inference and generative model, i.e. prior/posterior generate latent variables in the same order.

I think this means I can’t get away with just having a for loop over each stochastic layer in the *guide* for the inference model, and another one in the *model* for the generative model but maybe I’m mistaken.

I really appreciate any feedback on this!