用法
kl_divergence(
other, name='kl_divergence'
)参数
-
othertfp.distributions.Distribution实例。 -
namePythonstr附加在此函数创建的操作名称之前。
返回
-
kl_divergenceself.dtypeTensor与形状[B1, ..., Bn]表示n对 Kullback-Leibler 散度的不同计算。
计算 Kullback-Leibler 散度。
用 p 表示此分布 (self),用 q 表示 other 分布。假设 p, q 相对于参考测量 r 绝对连续,则 KL 散度定义为:
KL[p, q] = E_p[log(p(X)/q(X))]
= -int_F p(x) log q(x) dr(x) + int_F p(x) log p(x) dr(x)
= H[p, q] - H[p]
其中F表示随机变量的支持度X ~ p , H[., .]表示(Shanon)交叉熵,H[.]表示(Shanon)熵。
相关用法
- Python tf.compat.v1.distributions.Normal.log_survival_function用法及代码示例
- Python tf.compat.v1.distributions.Normal.log_cdf用法及代码示例
- Python tf.compat.v1.distributions.Normal.quantile用法及代码示例
- Python tf.compat.v1.distributions.Normal.stddev用法及代码示例
- Python tf.compat.v1.distributions.Normal.covariance用法及代码示例
- Python tf.compat.v1.distributions.Normal.variance用法及代码示例
- Python tf.compat.v1.distributions.Normal.survival_function用法及代码示例
- Python tf.compat.v1.distributions.Normal.cdf用法及代码示例
- Python tf.compat.v1.distributions.Normal.cross_entropy用法及代码示例
- Python tf.compat.v1.distributions.Normal用法及代码示例
- Python tf.compat.v1.distributions.Multinomial.stddev用法及代码示例
- Python tf.compat.v1.distributions.Bernoulli.cross_entropy用法及代码示例
- Python tf.compat.v1.distributions.Bernoulli.covariance用法及代码示例
- Python tf.compat.v1.distributions.Laplace.stddev用法及代码示例
- Python tf.compat.v1.distributions.Multinomial.quantile用法及代码示例
- Python tf.compat.v1.distributions.Uniform.log_survival_function用法及代码示例
- Python tf.compat.v1.distributions.Gamma.cdf用法及代码示例
- Python tf.compat.v1.distributions.Gamma.log_cdf用法及代码示例
- Python tf.compat.v1.distributions.Laplace.cross_entropy用法及代码示例
- Python tf.compat.v1.distributions.Dirichlet.covariance用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.compat.v1.distributions.Normal.kl_divergence。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
