elbo_objective

tfsnippet.elbo_objective(log_joint, latent_log_prob, axis=None, keepdims=False, name=None)

Derive the ELBO objective.

\[\mathbb{E}_{\mathbf{z} \sim q_{\phi}(\mathbf{z}|\mathbf{x})}\big[ \log p_{\theta}(\mathbf{x},\mathbf{z}) - \log q_{\phi}(\mathbf{z}|\mathbf{x}) \big]\]
Parameters:
  • log_joint – Values of \(\log p(\mathbf{z},\mathbf{x})\), computed with \(\mathbf{z} \sim q(\mathbf{z}|\mathbf{x})\).
  • latent_log_prob\(q(\mathbf{z}|\mathbf{x})\).
  • axis – The sampling dimensions to be averaged out. If None, no dimensions will be averaged out.
  • keepdims (bool) – When axis is specified, whether or not to keep the averaged dimensions? (default False)
  • name (str) – TensorFlow name scope of the graph nodes. (default “elbo_objective”)
Returns:

The ELBO objective. Not applicable for training.

Return type:

tf.Tensor