What is the mask=True doing in the poutine.mask function (HMM Example Code)


#1

The code:

I noticed that when sample transition and emission from the Dirichlet distribution, you applied this:

with poutine.mask(mask=include_prior), the include_prior is True here.

what is the mask=True doing here? Is it ok just removing this line.


#2

When include_prior == False, the log-probabilities of the sample sites inside that mask context are set to 0. This is used in the same file to evaluate the marginal likelihood of held-out data given the MAP values of the parameters. When include_prior == True, the model is equivalent to the same model with no mask context.