12 #ifndef MLPACK_METHODS_ANN_DISTRIBUTIONS_BERNOULLI_DISTRIBUTION_HPP 13 #define MLPACK_METHODS_ANN_DISTRIBUTIONS_BERNOULLI_DISTRIBUTION_HPP 16 #include "../activation_functions/logistic_function.hpp" 33 template <
typename DataType = arma::mat>
64 const bool applyLogistic =
true,
65 const double eps = 1e-10);
91 void LogProbBackward(
const DataType& observation, DataType& output)
const;
108 const DataType&
Logits()
const {
return logits; }
116 template<
typename Archive>
120 ar(CEREAL_NVP(probability));
121 ar(CEREAL_NVP(logits));
122 ar(CEREAL_NVP(applyLogistic));
128 DataType probability;
145 #include "bernoulli_distribution_impl.hpp" const DataType & Probability() const
Return the probability matrix.
void LogProbBackward(const DataType &observation, DataType &output) const
Stores the gradient of the log probabilities of the observations in the output matrix.
Linear algebra utility functions, generally performed on matrices or vectors.
void serialize(Archive &ar, const uint32_t)
Serialize the distribution.
The core includes that mlpack expects; standard C++ includes and Armadillo.
double LogProbability(const DataType &observation) const
Return the log probabilities of the given matrix of observations.
const DataType & Logits() const
Return the logits matrix.
Multiple independent Bernoulli distributions.
double Probability(const DataType &observation) const
Return the probabilities of the given matrix of observations.
DataType & Logits()
Return a modifiable copy of the pre probability matrix.
DataType & Probability()
Return a modifiable copy of the probability matrix.
BernoulliDistribution()
Default constructor, which creates a Bernoulli distribution with zero dimension.
DataType Sample() const
Return a matrix of randomly generated samples according to the probability distributions defined by t...