来源:https://tensorflow.google.cn/api_docs/python/tf/distributions/kl_divergence
tf.distributions.kl_divergence(
distribution_a,
distribution_b,
allow_nan_stats=True,
name=None
)
KL散度,也就是两个分布的相对熵,体现的是两个分布的相似程度,熵越小越相似
Args:
distribution_a
: The first distribution.distribution_b
: The second distribution.allow_nan_stats
: Pythonbool
, defaultTrue
. WhenTrue
, statistics (e.g., mean, mode, variance) use the value "NaN
" to indicate the result is undefined. WhenFalse
, an exception is raised if one or more of the statistic's batch members are undefined.name
: Pythonstr
name prefixed to Ops created by this class.