28 #ifndef GUM_SAMPLING_INFERENCE_H 29 #define GUM_SAMPLING_INFERENCE_H 56 template <
typename GUM_SCALAR >
171 GUM_SCALAR virtualLBPSize);
249 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS void _onAllEvidenceErased(bool contains_hard_evidence) override
fired before all the evidence are erased
aGrUM's Potential is a multi-dimensional array with tensor operators.
This file contains Gibbs sampling (for BNs) class definitions.
virtual void contextualize()
Simplifying the bayesian network with relevance reasonning to lighten the computational charge...
This file contains general scheme for iteratively convergent algorithms.
virtual Instantiation _draw(GUM_SCALAR *w, Instantiation prev)=0
draws a sample in the bayesian network given a previous one
SamplingInference(const IBayesNet< GUM_SCALAR > *bn)
default constructor
void _updateOutdatedBNStructure() override
prepares inference when the latter is in OutdatedBNStructure state
Class representing Bayesian networks.
~SamplingInference() override
destructor
void _loopApproxInference()
virtual void _setEstimatorFromBN()
Initializes the estimators object linked to the simulation.
Class representing the minimal interface for Bayesian Network.
gum is the global namespace for all aGrUM entities
void _onMarginalTargetAdded(const NodeId id) override
fired after a new marginal target is inserted
Implementation of the non pure virtual methods of class ApproximateInference.
This file contains the abstract inference class definition for computing (incrementally) marginal pos...
void _onStateChanged() override
fired when the stage is changed
void _onAllMarginalTargetsAdded() override
fired after all the nodes of the BN are added as marginal targets
void _onEvidenceAdded(const NodeId id, bool isHardEvidence) override
fired after a new evidence is inserted
void _onEvidenceErased(const NodeId id, bool isHardEvidence) override
fired before an evidence is removed
const Potential< GUM_SCALAR > & currentPosterior(NodeId id)
Computes and returns the actual estimation of the posterior of a node.
virtual Instantiation _burnIn()=0
draws samples without updating the estimators
Estimator< GUM_SCALAR > __estimator
Estimator object designed to approximate target posteriors.
Header files of gum::Instantiation.
<agrum/BN/inference/loopyBeliefPropagation.h>
Portion of a BN identified by the list of nodes and a BayesNet.
BayesNetFragment< GUM_SCALAR > * __samplingBN
const Potential< GUM_SCALAR > & _posterior(NodeId id) override
Computes and returns the posterior of a node.
void _makeInference() override
makes the inference by generating samples
Class for assigning/browsing values to tuples of discrete variables.
virtual void _setEstimatorFromLBP(LoopyBeliefPropagation< GUM_SCALAR > *lbp, GUM_SCALAR virtualLBPSize)
Initializes the estimators object linked to the simulation.
void _onMarginalTargetErased(const NodeId id) override
fired before a marginal target is removed
bool isContextualized
whether the referenced Bayesian Network has been "contextualized"
void _onAllMarginalTargetsErased() override
fired before a all marginal targets are removed
This file contains estimating tools for approximate inference.
virtual void _onContextualize(BayesNetFragment< GUM_SCALAR > *bn)
fired when Bayesian network is contextualized
void _updateOutdatedBNPotentials() override
prepares inference when the latter is in OutdatedBNPotentials state
bool isSetEstimator
whether the Estimator object has been initialized
virtual void _addVarSample(NodeId nod, Instantiation *I)
adds a node to current instantiation
void _onBayesNetChanged(const IBayesNet< GUM_SCALAR > *bn) override
fired after a new Bayes net has been assigned to the engine
Size NodeId
Type for node ids.
const IBayesNet< GUM_SCALAR > & samplingBN()
get the BayesNet which is used to really perform the sampling
Class representing Fragment of Bayesian networks.
void _onEvidenceChanged(const NodeId id, bool hasChangedSoftHard) override
fired after an evidence is changed, in particular when its status (soft/hard) changes ...