コード例 #1
0
ファイル: bn.py プロジェクト: hmartelb/zhusuan-mnist-cvae
    def beta(self,
             name,
             alpha,
             beta,
             n_samples=None,
             group_ndims=0,
             check_numerics=False,
             **kwargs):
        """
        Add a stochastic node in this :class:`BayesianNet` that follows the
        Beta distribution.

        :param name: The name of the stochastic node. Must be unique in a
            :class:`BayesianNet`.

        See
        :class:`~zhusuan.distributions.univariate.Beta` for more information
        about the other arguments.

        :return: A :class:`StochasticTensor` instance.
        """
        dist = distributions.Beta(alpha,
                                  beta,
                                  group_ndims=group_ndims,
                                  check_numerics=check_numerics,
                                  **kwargs)
        return self.stochastic(name, dist, n_samples=n_samples, **kwargs)
コード例 #2
0
ファイル: stochastic.py プロジェクト: wmyw96/ZhuSuan
 def __init__(self,
              name,
              alpha,
              beta,
              n_samples=None,
              group_event_ndims=0,
              check_numerics=False):
     beta = distributions.Beta(alpha,
                               beta,
                               group_event_ndims=group_event_ndims,
                               check_numerics=check_numerics)
     super(Beta, self).__init__(name, beta, n_samples)