| ||BernoulliDistribution ()|
| ||Default constructor, which creates a Bernoulli distribution with zero dimension. More...|
| ||BernoulliDistribution (const DataType ¶m, const bool applyLogistic=true, const double eps=1e-10)|
| ||Create multiple independent Bernoulli distributions whose p values are given by the param parameter. More...|
|const DataType & ||Logits () const|
| ||Return the logits matrix. More...|
|DataType & ||Logits ()|
| ||Return a modifiable copy of the pre probability matrix. More...|
|double ||LogProbability (const DataType &observation) const|
| ||Return the log probabilities of the given matrix of observations. More...|
|void ||LogProbBackward (const DataType &observation, DataType &output) const|
| ||Stores the gradient of the log probabilities of the observations in the output matrix. More...|
|double ||Probability (const DataType &observation) const|
| ||Return the probabilities of the given matrix of observations. More...|
|const DataType & ||Probability () const|
| ||Return the probability matrix. More...|
|DataType & ||Probability ()|
| ||Return a modifiable copy of the probability matrix. More...|
|DataType ||Sample () const|
| ||Return a matrix of randomly generated samples according to the probability distributions defined by this object. More...|
|void ||serialize (Archive &ar, const uint32_t)|
| ||Serialize the distribution. More...|
class mlpack::ann::BernoulliDistribution< DataType >
Multiple independent Bernoulli distributions.
Bernoulli distribution is the discrete probability distribution of a random variable which takes the value 1 with probability p and the value 0 with probability q = 1 - p. In this implementation, the p values of the distributions are given by the param matrix.
- Template Parameters
|DataType||Type of the input data. (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
Definition at line 34 of file bernoulli_distribution.hpp.
||const DataType &
Create multiple independent Bernoulli distributions whose p values are given by the param parameter.
Thus, we create nofRows * nofColumns distributions. The shape of the matrix of distributions is the same as the shape of the param matrix as each element of the param matrix parameterizes one Bernoulli distribution. This is used in the ANN module to define distribution for each feature in each batch, where number of features becomes nofRows and batch size becomes nofColumns.
applyLogistic has to be true if all the elements of param matrix are not in the range [0, 1].
|param||The matrix of probabilities or pre probabilities of the multiple distributions. |
|applyLogistic||If true, we apply Logistic function to the param matrix (pre probability) to get probability. |
|eps||The minimum value used for computing logarithms and denominators. |