def latent_perplexity(self):
"""Compute perplexity = exp(entropy) of latent variables.
Perplexity is an information theoretic measure of the number of
clusters or latent classes. Perplexity is a real number in the range
[1, M], where M is model_num_clusters.
Returns:
A [V]-shaped numpy array of perplexity.
"""
result = self._ensemble[0].latent_perplexity()
for server in self._ensemble[1:]:
result += server.latent_perplexity()
result /= len(self._ensemble)
return result
评论列表
文章目录