aGrUM  0.16.0
GibbsSampling.h
Go to the documentation of this file.
1 
31 #ifndef GUM_GIBBS_SAMPLING_H
32 #define GUM_GIBBS_SAMPLING_H
33 
36 
37 
38 namespace gum {
39 
54  template < typename GUM_SCALAR >
56  : public SamplingInference< GUM_SCALAR >
57  , public GibbsOperator< GUM_SCALAR > {
58  public:
62  explicit GibbsSampling(const IBayesNet< GUM_SCALAR >* bn);
63 
67  ~GibbsSampling() override;
68 
74  void setBurnIn(Size b) { this->_burn_in = b; };
75 
80  Size burnIn() const { return this->_burn_in; };
81 
82  protected:
84  Instantiation _burnIn() override;
85 
87 
100  Instantiation _draw(GUM_SCALAR* w, Instantiation prev) override;
101 
103 
114  };
115 
116 
117 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
118  extern template class GibbsSampling< double >;
119 #endif
120 } // namespace gum
121 
123 #endif
~GibbsSampling() override
Destructor.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
GibbsSampling(const IBayesNet< GUM_SCALAR > *bn)
Default constructor.
void setBurnIn(Size b)
Number of burn in for one iteration.
Definition: GibbsSampling.h:74
Class representing the minimal interface for Bayesian Network.
Definition: IBayesNet.h:62
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.
Definition: agrum.h:25
<agrum/BN/inference/gibbsSampling.h>
Definition: GibbsSampling.h:55
Size _burn_in
Number of iterations before checking stopping criteria.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Size burnIn() const
Returns the number of burn in.
Definition: GibbsSampling.h:80
Instantiation _monteCarloSample()
draws a Monte Carlo sample
Class for assigning/browsing values to tuples of discrete variables.
Definition: instantiation.h:83
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
Instantiation _burnIn() override
draws a defined number of samples without updating the estimators
class containing all variables and methods required for Gibbssampling
Definition: gibbsOperator.h:50