32 #define GIBBS_SAMPLING_DEFAULT_EPSILON std::exp(-1.6) 33 #define GIBBS_SAMPLING_DEFAULT_MIN_EPSILON_RATE std::exp(-5) 34 #define GIBBS_SAMPLING_DEFAULT_BURNIN 300 36 #define GIBBS_SAMPLING_POURCENT_DRAWN_SAMPLE 50 // percent drawn 37 #define GIBBS_SAMPLING_DRAWN_AT_RANDOM true 42 template <
typename GUM_SCALAR >
47 &this->hardEvidence(),
58 template <
typename GUM_SCALAR >
64 template <
typename GUM_SCALAR >
70 template <
typename GUM_SCALAR >
73 if (this->
burnIn() == 0)
return Ip;
78 Ip = this->
_draw(&w, Ip);
85 template <
typename GUM_SCALAR >
~GibbsSampling() override
Destructor.
GibbsSampling(const IBayesNet< GUM_SCALAR > *bn)
Default constructor.
void setBurnIn(Size b)
Number of burn in for one iteration.
Class representing the minimal interface for Bayesian Network.
Instantiation _draw(GUM_SCALAR *w, Instantiation prev) override
draws a sample given previous one according to Gibbs sampling
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void setMinEpsilonRate(double rate)
Given that we approximate f(t), stopping criterion on d/dt(|f(t+1)-f(t)|).
#define GIBBS_SAMPLING_DEFAULT_BURNIN
#define GIBBS_SAMPLING_DEFAULT_MIN_EPSILON_RATE
<agrum/BN/inference/gibbsSampling.h>
#define GIBBS_SAMPLING_DEFAULT_EPSILON
Instantiation nextSample(Instantiation prev)
draws next sample of Gibbs sampling
#define GIBBS_SAMPLING_POURCENT_DRAWN_SAMPLE
Size burnIn() const
Returns the number of burn in.
Instantiation _monteCarloSample()
draws a Monte Carlo sample
Class for assigning/browsing values to tuples of discrete variables.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Instantiation monteCarloSample()
draws a Monte Carlo sample
void setEpsilon(double eps)
Given that we approximate f(t), stopping criterion on |f(t+1)-f(t)|.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
#define GIBBS_SAMPLING_DRAWN_AT_RANDOM
Instantiation _burnIn() override
draws a defined number of samples without updating the estimators
class containing all variables and methods required for Gibbssampling