What is a sample site?

I noticed that the sample site was mentioned very often in the documents. Can I consider below as a sample site?

z = pyro.sample(“z”, dist.Categorical(torch.ones(5)))

When doing inference, the z can be enumerated sequentially or fully.

Yes, I think
A sample site, from my view, corresponds to a pyro.sample.

pyro.sample will generate a message containing the type, name, fn, and other information. The message then is sent to the Messengers. The messengers can modify the message information based on the background running context and the backend stack that stores sequentially the different Messengers.

3 Likes

Hi beyondpie, thank you very much for your detailed explanation. I can see, from your reply, the sample is not simply a sample, it contains much more information controlled by the messengers.