Batch Shape of Nested Plates


#1

Let’s say, there are two plates and one is in another one. The first size is 10 and the second plate size is 5.

In this case, if my understanding is correct, should the batch_shape of the distribution be [10, 5]?

with pyro.plate(...,10, dim=-2)
   some code
   with pyro.plate(...,5, dim=-1)
       z = pyro.sample(..., distribution, ...)

#2

yes, you can print the shapes out to verify them yourself. if you haven’t yet, i recommend taking a look at this tutorial which goes through a variety of examples.


#3

Thank you very much, that is helpful!