mxfusion.components.distributions.pointmass¶
Members¶
-
class
mxfusion.components.distributions.pointmass.
PointMass
(location, rand_gen=None, dtype=None, ctx=None)¶ Bases:
mxfusion.components.distributions.univariate.UnivariateDistribution
The Point Mass distribution.
Parameters: value – the location of the point mass. -
log_pdf
(F, variables)¶ Computes the logrithm of the probability density/mass function (PDF/PMF) of the distribution. The inputs and outputs variables are fetched from the variables argument according to their UUIDs.
Parameters: - F (mxnet.symbol or mxnet.ndarray) – the MXNet computation mode
- variables – the set of MXNet arrays that holds the values of
variables at runtime. :type variables: {str(UUID): MXNet NDArray or MXNet Symbol} :returns: log pdf of the distribution :rtypes: MXNet NDArray or MXNet Symbol
-
draw_samples
(F, variables, num_samples=1, always_return_tuple=False)¶ Draw a set of samples from the distribution. The inputs variables are fetched from the variables argument according to their UUIDs.
Parameters: - F (mxnet.symbol or mxnet.ndarray) – the MXNet computation mode
- variables – the set of MXNet arrays that holds the values of
variables at runtime. :type variables: {str(UUID): MXNet NDArray or MXNet Symbol} :param num_samples: the number of drawn samples (default: one) :int num_samples: int :param always_return_tuple: Whether return a tuple even if there is only one variables in outputs. :type always_return_tuple: boolean :returns: a set samples of the distribution :rtypes: MXNet NDArray or MXNet Symbol or [MXNet NDArray or MXNet Symbol]
-
static
define_variable
(location, shape=None, rand_gen=None, dtype=None, ctx=None)¶ Creates and returns a random variable drawn from a Normal distribution.
Parameters: - location – the location of the point mass.
- shape – Shape of random variables drawn from the distribution. If non-scalar, each variable is drawn iid.
Returns: RandomVariable drawn from the distribution specified.
-