def __init__(self,
alpha,
beta,
dtype=None,
group_ndims=0,
check_numerics=False,
**kwargs):
self._alpha = tf.convert_to_tensor(alpha)
self._beta = tf.convert_to_tensor(beta)
dtype = assert_same_float_dtype(
[(self._alpha, 'Beta.alpha'),
(self._beta, 'Beta.beta')])
try:
tf.broadcast_static_shape(self._alpha.get_shape(),
self._beta.get_shape())
except ValueError:
raise ValueError(
"alpha and beta should be broadcastable to match each "
"other. ({} vs. {})".format(
self._alpha.get_shape(), self._beta.get_shape()))
self._check_numerics = check_numerics
super(Beta, self).__init__(
dtype=dtype,
param_dtype=dtype,
is_continuous=True,
is_reparameterized=False,
group_ndims=group_ndims,
**kwargs)
评论列表
文章目录