aGrUM  0.16.0
importanceSampling.h
Go to the documentation of this file.
1 
31 #ifndef GUM_IMPORTANCE_INFERENCE_H
32 #define GUM_IMPORTANCE_INFERENCE_H
33 
35 
36 namespace gum {
37 
51  template < typename GUM_SCALAR >
52  class ImportanceSampling : public SamplingInference< GUM_SCALAR > {
53  public:
57  explicit ImportanceSampling(const IBayesNet< GUM_SCALAR >* bn);
58 
59 
63  ~ImportanceSampling() override;
64 
65  protected:
67  Instantiation _burnIn() override;
68 
69 
71 
83  Instantiation _draw(GUM_SCALAR* w, Instantiation prev) override;
84 
85 
87 
97 
99 
110  };
111 
112 
113 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
114  extern template class ImportanceSampling< double >;
115 #endif
116 } // namespace gum
117 
119 
120 #endif
~ImportanceSampling() override
Destructor.
Instantiation _burnIn() override
draws a defined number of samples without updating the estimators
ImportanceSampling(const IBayesNet< GUM_SCALAR > *bn)
Default constructor.
Class representing the minimal interface for Bayesian Network.
Definition: IBayesNet.h:62
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Instantiation _draw(GUM_SCALAR *w, Instantiation prev) override
draws a sample according to Importance sampling
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Portion of a BN identified by the list of nodes and a BayesNet.
Class for assigning/browsing values to tuples of discrete variables.
Definition: instantiation.h:83
void _unsharpenBN(BayesNetFragment< GUM_SCALAR > *bn, float epsilon)
modifies the cpts of a BN in order to tend to uniform distributions
double epsilon() const
Returns the value of epsilon.
void _onContextualize(BayesNetFragment< GUM_SCALAR > *bn) override
fired when Bayesian network is contextualized