If I run a simple Gaussian Mixture Model with enumerated MCMC in numpyro, I can retrospectively sample (or choose the MAP) cluster assignments for each row for each MCMC sample with infer_discrete.
How do I instead get the posterior assignment probabilities for each row for each sample?
(e.g. If I have a 3 cluster mixture model and the MAP cluster assignment for row 0 is 1, I might expect to have the function return [.05, .9, .05]. It should be possible to compute this for each MCMC sample/row/cluster by taking p(row_i in cluster_j at sample_k) = \frac{density(row_i, cluster_j | latents_k, data)}{\sum_{j=0}^{j=nclusters - 1}{density(row_i, cluster_j | latents_k, data)}} a la Mixture Models | Dan Foreman-Mackey)
I think this would involve manipulating the _log_enum_density function to change the way likelihoods are accumulated in funsor, but I do not understand the funsor code well enough to come up with a solution.