本文整理汇总了Python中tensorflow.python.ops.special_math_ops.lbeta方法的典型用法代码示例。如果您正苦于以下问题:Python special_math_ops.lbeta方法的具体用法?Python special_math_ops.lbeta怎么用?Python special_math_ops.lbeta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tensorflow.python.ops.special_math_ops
的用法示例。
在下文中一共展示了special_math_ops.lbeta方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _log_prob
# 需要导入模块: from tensorflow.python.ops import special_math_ops [as 别名]
# 或者: from tensorflow.python.ops.special_math_ops import lbeta [as 别名]
def _log_prob(self, counts):
counts = self._maybe_assert_valid_sample(counts)
ordered_prob = (
special_math_ops.lbeta(self.concentration + counts)
- special_math_ops.lbeta(self.concentration))
return ordered_prob + distribution_util.log_combinations(
self.total_count, counts)
示例2: _entropy
# 需要导入模块: from tensorflow.python.ops import special_math_ops [as 别名]
# 或者: from tensorflow.python.ops.special_math_ops import lbeta [as 别名]
def _entropy(self):
v = array_ops.ones(self.batch_shape_tensor(),
dtype=self.dtype)[..., array_ops.newaxis]
u = v * self.df[..., array_ops.newaxis]
beta_arg = array_ops.concat([u, v], -1) / 2.
return (math_ops.log(math_ops.abs(self.scale)) +
0.5 * math_ops.log(self.df) +
special_math_ops.lbeta(beta_arg) +
0.5 * (self.df + 1.) *
(math_ops.digamma(0.5 * (self.df + 1.)) -
math_ops.digamma(0.5 * self.df)))
示例3: _log_normalization
# 需要导入模块: from tensorflow.python.ops import special_math_ops [as 别名]
# 或者: from tensorflow.python.ops.special_math_ops import lbeta [as 别名]
def _log_normalization(self):
return special_math_ops.lbeta(self.concentration)
示例4: _log_prob
# 需要导入模块: from tensorflow.python.ops import special_math_ops [as 别名]
# 或者: from tensorflow.python.ops.special_math_ops import lbeta [as 别名]
def _log_prob(self, counts):
counts = self._assert_valid_counts(counts)
ordered_prob = (special_math_ops.lbeta(self.alpha + counts) -
special_math_ops.lbeta(self.alpha))
log_prob = ordered_prob + distribution_util.log_combinations(
self.n, counts)
return log_prob
示例5: _entropy
# 需要导入模块: from tensorflow.python.ops import special_math_ops [as 别名]
# 或者: from tensorflow.python.ops.special_math_ops import lbeta [as 别名]
def _entropy(self):
v = array_ops.ones(self.batch_shape(), dtype=self.dtype)[..., None]
u = v * self.df[..., None]
beta_arg = array_ops.concat([u, v], -1) / 2.
return (math_ops.log(math_ops.abs(self.sigma)) +
0.5 * math_ops.log(self.df) +
special_math_ops.lbeta(beta_arg) +
0.5 * (self.df + 1.) *
(math_ops.digamma(0.5 * (self.df + 1.)) -
math_ops.digamma(0.5 * self.df)))
示例6: _log_prob
# 需要导入模块: from tensorflow.python.ops import special_math_ops [as 别名]
# 或者: from tensorflow.python.ops.special_math_ops import lbeta [as 别名]
def _log_prob(self, x):
x = ops.convert_to_tensor(x, name="x")
x = self._assert_valid_sample(x)
unnorm_prob = (self.alpha - 1.) * math_ops.log(x)
log_prob = math_ops.reduce_sum(
unnorm_prob, reduction_indices=[-1],
keep_dims=False) - special_math_ops.lbeta(self.alpha)
return log_prob
示例7: _entropy
# 需要导入模块: from tensorflow.python.ops import special_math_ops [as 别名]
# 或者: from tensorflow.python.ops.special_math_ops import lbeta [as 别名]
def _entropy(self):
entropy = special_math_ops.lbeta(self.alpha)
entropy += math_ops.digamma(self.alpha_sum) * (
self.alpha_sum - math_ops.cast(self.event_shape()[0], self.dtype))
entropy += -math_ops.reduce_sum(
(self.alpha - 1.) * math_ops.digamma(self.alpha),
reduction_indices=[-1],
keep_dims=False)
return entropy
示例8: _entropy
# 需要导入模块: from tensorflow.python.ops import special_math_ops [as 别名]
# 或者: from tensorflow.python.ops.special_math_ops import lbeta [as 别名]
def _entropy(self):
u = array_ops.expand_dims(self.df * self._ones(), -1)
v = array_ops.expand_dims(self._ones(), -1)
beta_arg = array_ops.concat(len(u.get_shape()) - 1, [u, v]) / 2
half_df = 0.5 * self.df
return ((0.5 + half_df) * (math_ops.digamma(0.5 + half_df) -
math_ops.digamma(half_df)) +
0.5 * math_ops.log(self.df) +
special_math_ops.lbeta(beta_arg) +
math_ops.log(self.sigma))