monte_carlo_objective¶
-
tfsnippet.
monte_carlo_objective
(log_joint, latent_log_prob, axis=None, keepdims=False, name=None)¶ Derive the Monte-Carlo objective.
\[\mathcal{L}_{K}(\mathbf{x};\theta,\phi) = \mathbb{E}_{\mathbf{z}^{(1:K)} \sim q_{\phi}(\mathbf{z}|\mathbf{x})}\Bigg[ \log \frac{1}{K} \sum_{k=1}^K { \frac{p_{\theta}(\mathbf{x},\mathbf{z}^{(k)})} {q_{\phi}(\mathbf{z}^{(k)}|\mathbf{x})} } \Bigg]\]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.
- 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 “monte_carlo_objective”)
Returns: The Monte Carlo objective. Not applicable for training.
Return type: tf.Tensor