def uniform(self, name, minval=0., maxval=1., n_samples=None, group_ndims=0, is_reparameterized=True, check_numerics=False, **kwargs): """ Add a stochastic node in this :class:`BayesianNet` that follows the Uniform distribution. :param name: The name of the stochastic node. Must be unique in a :class:`BayesianNet`. See :class:`~zhusuan.distributions.univariate.Uniform` for more information about the other arguments. :return: A :class:`StochasticTensor` instance. """ dist = distributions.Uniform(minval, maxval, group_ndims=group_ndims, is_reparameterized=is_reparameterized, check_numerics=check_numerics, **kwargs) return self.stochastic(name, dist, n_samples=n_samples, **kwargs)
def __init__(self, minval=0., maxval=1., is_reparameterized=True, check_numerics=False): """ Construct the :class:`Uniform`. Args: minval: A `float` Tensor. The lower bound on the range of the uniform distribution. Should be broadcastable to match `maxval`. maxval: A `float` Tensor. The upper bound on the range of the uniform distribution. Should be element-wise bigger than `minval`. is_reparameterized (bool): Whether or not the gradients can be propagated through parameters? (default :obj:`True`) check_numerics (bool): Whether or not to check numeric issues. """ super(Uniform, self).__init__( zd.Uniform( minval=minval, maxval=maxval, is_reparameterized=is_reparameterized, check_numerics=check_numerics, ))
def __init__(self, name, minval=0., maxval=1., n_samples=None, group_event_ndims=0, is_reparameterized=True, check_numerics=False): uniform = distributions.Uniform(minval, maxval, group_event_ndims=group_event_ndims, is_reparameterized=is_reparameterized, check_numerics=check_numerics) super(Uniform, self).__init__(name, uniform, n_samples)
def __init__(self, minval=0., maxval=1., check_numerics=False): """ Construct the :class:`Uniform`. Args: minval: A `float` Tensor. The lower bound on the range of the uniform distribution. Should be broadcastable to match `maxval`. maxval: A `float` Tensor. The upper bound on the range of the uniform distribution. Should be element-wise bigger than `minval`. check_numerics (bool): Whether or not to check numeric issues. """ super(Uniform, self).__init__( zd.Uniform( minval=minval, maxval=maxval, check_numerics=check_numerics))