Closed fehiepsi closed 3 years ago
This looks like another edifying application of funsors 🙂 . You may be able to simply call .sample()
on the final funsor in enumeration, then unpack the resulting Delta
funsors.
This is achieved through infer_discrete
.
Per @martinjankowiak suggestion, after we marginalize discrete latent variables to run HMC and get posterior for continuous variables, it would be nice to have a utility to get posterior samples for discrete latent variables. That is we have a model with
p(data | discrete, continuous)
, we marginalize and run MCMC to getp(continuous | data)
. This utility will get samples fromp(discrete | data, continuous)
.References: