garage.tf.distributions.bernoulli module¶
-
class
Bernoulli
(dim, name='Bernoulli')[source]¶ Bases:
garage.tf.distributions.distribution.Distribution
-
entropy
(dist_info)[source]¶ Entropy of a distribution.
Parameters: dist_info (dict) – Parameters of a distribution. Returns: Entropy of the distribution. Return type: float
-
kl
(old_dist_info, new_dist_info)[source]¶ Compute the KL divergence of two distributions.
Parameters: Returns: KL Divergence between two distributions.
Return type:
-
kl_sym
(old_dist_info_vars, new_dist_info_vars, name='kl_sym')[source]¶ Compute the symbolic KL divergence of two distributions.
Parameters: - old_dist_info_vars (tf.Tensor) – Symbolic parameters of the old distribution.
- new_dist_info_vars (tf.Tensor) – Symbolic parameters of the new distribution.
- name (str) – TensorFlow scope name.
Returns: Symbolic KL divergence between the two distributions.
Return type: tf.Tensor
-
likelihood_ratio_sym
(x_var, old_dist_info_vars, new_dist_info_vars, name='likelihood_ratio_sym')[source]¶ Symbolic likelihood ratio.
Parameters: Returns: Symbolic likelihood ratio.
Return type: tf.Tensor
-
log_likelihood
(xs, dist_info)[source]¶ Log likelihood of a sample under a distribution.
Parameters: - xs (np.ndarray) – Input value.
- dist_info (dict) – Parameters of a distribution.
Returns: Log likelihood of a sample under the distribution.
Return type:
-