![]() |
aGrUM
0.14.2
|
<agrum/BN/inference/BayesNetInference.h> More...
#include <BayesNetInference.h>
Public Member Functions | |
Constructors / Destructors | |
BayesNetInference (const IBayesNet< GUM_SCALAR > *bn) | |
default constructor More... | |
BayesNetInference () | |
default constructor with a null BN (useful for virtual inheritance) More... | |
virtual | ~BayesNetInference () |
destructor More... | |
Accessors / Modifiers | |
virtual void | setBN (const IBayesNet< GUM_SCALAR > *bn) |
assigns a new BN to the inference engine More... | |
virtual const IBayesNet< GUM_SCALAR > & | BN () const final |
Returns a constant reference over the IBayesNet referenced by this class. More... | |
virtual const NodeProperty< Size > & | domainSizes () const final |
get the domain sizes of the random variables of the BN More... | |
virtual bool | isInferenceReady () const noexcept final |
returns whether the inference object is in a ready state More... | |
virtual bool | isInferenceOutdatedBNStructure () const noexcept final |
returns whether the inference object is in a OutdatedBNStructure state More... | |
virtual bool | isInferenceOutdatedBNPotentials () const noexcept final |
returns whether the inference object is in a OutdatedBNPotential state More... | |
virtual bool | isInferenceDone () const noexcept final |
returns whether the inference object is in a InferenceDone state More... | |
virtual bool | isDone () const noexcept final |
returns whether the inference object is in a done state More... | |
virtual void | prepareInference () final |
prepare the internal inference structures for the next inference More... | |
virtual void | makeInference () final |
perform the heavy computations needed to compute the targets' posteriors More... | |
virtual void | clear () |
clears all the data structures allocated for the last inference More... | |
virtual StateOfInference | state () const noexcept final |
returns the state of the inference engine More... | |
Evidence | |
virtual void | addEvidence (NodeId id, const Idx val) final |
adds a new hard evidence on node id More... | |
virtual void | addEvidence (const std::string &nodeName, const Idx val) final |
adds a new hard evidence on node named nodeName More... | |
virtual void | addEvidence (NodeId id, const std::string &label) final |
adds a new hard evidence on node id More... | |
virtual void | addEvidence (const std::string &nodeName, const std::string &label) final |
adds a new hard evidence on node named nodeName More... | |
virtual void | addEvidence (NodeId id, const std::vector< GUM_SCALAR > &vals) final |
adds a new evidence on node id (might be soft or hard) More... | |
virtual void | addEvidence (const std::string &nodeName, const std::vector< GUM_SCALAR > &vals) final |
adds a new evidence on node named nodeName (might be soft or hard) More... | |
virtual void | addEvidence (const Potential< GUM_SCALAR > &pot) final |
adds a new evidence on node id (might be soft or hard) More... | |
virtual void | addEvidence (Potential< GUM_SCALAR > &&pot) final |
adds a new evidence on node id (might be soft or hard) More... | |
virtual void | addSetOfEvidence (const Set< const Potential< GUM_SCALAR > * > &potset) final |
adds a new set of evidence More... | |
virtual void | addListOfEvidence (const List< const Potential< GUM_SCALAR > * > &potlist) final |
adds a new list of evidence More... | |
virtual void | chgEvidence (NodeId id, const Idx val) final |
change the value of an already existing hard evidence More... | |
virtual void | chgEvidence (const std::string &nodeName, const Idx val) final |
change the value of an already existing hard evidence More... | |
virtual void | chgEvidence (NodeId id, const std::string &label) final |
change the value of an already existing hard evidence More... | |
virtual void | chgEvidence (const std::string &nodeName, const std::string &label) final |
change the value of an already existing hard evidence More... | |
virtual void | chgEvidence (NodeId id, const std::vector< GUM_SCALAR > &vals) final |
change the value of an already existing evidence (might be soft or hard) More... | |
virtual void | chgEvidence (const std::string &nodeName, const std::vector< GUM_SCALAR > &vals) final |
change the value of an already existing evidence (might be soft or hard) More... | |
virtual void | chgEvidence (const Potential< GUM_SCALAR > &pot) final |
change the value of an already existing evidence (might be soft or hard) More... | |
virtual void | eraseAllEvidence () final |
removes all the evidence entered into the network More... | |
virtual void | eraseEvidence (NodeId id) final |
removed the evidence, if any, corresponding to node id More... | |
virtual void | eraseEvidence (const std::string &nodeName) final |
removed the evidence, if any, corresponding to node of name nodeName More... | |
virtual bool | hasEvidence () const final |
indicates whether some node(s) have received evidence More... | |
virtual bool | hasEvidence (NodeId id) const final |
indicates whether node id has received an evidence More... | |
virtual bool | hasHardEvidence (NodeId id) const final |
indicates whether node id has received a hard evidence More... | |
virtual bool | hasSoftEvidence (NodeId id) const final |
indicates whether node id has received a soft evidence More... | |
virtual bool | hasEvidence (const std::string &nodeName) const final |
indicates whether node id has received an evidence More... | |
virtual bool | hasHardEvidence (const std::string &nodeName) const final |
indicates whether node id has received a hard evidence More... | |
virtual bool | hasSoftEvidence (const std::string &nodeName) const final |
indicates whether node id has received a soft evidence More... | |
virtual Size | nbrEvidence () const final |
returns the number of evidence entered into the Bayesian network More... | |
virtual Size | nbrHardEvidence () const final |
returns the number of hard evidence entered into the Bayesian network More... | |
virtual Size | nbrSoftEvidence () const final |
returns the number of soft evidence entered into the Bayesian network More... | |
const NodeProperty< const Potential< GUM_SCALAR > *> & | evidence () const |
returns the set of evidence More... | |
const NodeSet & | softEvidenceNodes () const |
returns the set of nodes with soft evidence More... | |
const NodeSet & | hardEvidenceNodes () const |
returns the set of nodes with hard evidence More... | |
const NodeProperty< Idx > & | hardEvidence () const |
indicate for each node with hard evidence which value it took More... | |
Public Types | |
enum | StateOfInference { StateOfInference::OutdatedBNStructure, StateOfInference::OutdatedBNPotentials, StateOfInference::ReadyForInference, StateOfInference::Done } |
current state of the inference More... | |
Protected Member Functions | |
virtual void | _onStateChanged ()=0 |
fired when the stage is changed More... | |
virtual void | _onEvidenceAdded (const NodeId id, bool isHardEvidence)=0 |
fired after a new evidence is inserted More... | |
virtual void | _onEvidenceErased (const NodeId id, bool isHardEvidence)=0 |
fired before an evidence is removed More... | |
virtual void | _onAllEvidenceErased (bool contains_hard_evidence)=0 |
fired before all the evidence are erased More... | |
virtual void | _onEvidenceChanged (const NodeId id, bool hasChangedSoftHard)=0 |
fired after an evidence is changed, in particular when its status (soft/hard) changes More... | |
virtual void | _onBayesNetChanged (const IBayesNet< GUM_SCALAR > *bn)=0 |
fired after a new Bayes net has been assigned to the engine More... | |
virtual void | _updateOutdatedBNStructure ()=0 |
prepares inference when the latter is in OutdatedBNStructure state More... | |
virtual void | _updateOutdatedBNPotentials ()=0 |
prepares inference when the latter is in OutdatedBNPotentials state More... | |
virtual void | _makeInference ()=0 |
called when the inference has to be performed effectively More... | |
void | _setOutdatedBNStructureState () |
put the inference into an outdated BN structure state More... | |
void | _setOutdatedBNPotentialsState () |
puts the inference into an OutdatedBNPotentials state if it is not already in an OutdatedBNStructure state More... | |
<agrum/BN/inference/BayesNetInference.h>
A generic class for Bayes net inference: handles evidence and the current state of the (incremental) inference
The goal of the BayesNetInference class is twofold: i) handling the common resources of BN inference (bn, soft/hard evidence); ii) propose a general high-level scheme for all the inference methods.
A specialized inference just has to specify how to prepare inference, how to make inference and how to get the posteriors for nodes and set of nodes. The scheme for every inference derived from BayesNetInference will be the same:
1- ie=SpecificInference(bn); // state <- OutdatedBNStructure 2- set targets and evidence in ie 3- ie.prepareInference(); // state <- Ready4Inference 4.a- change values of evidence in ie // state <- OutdatedBNPotentials 4.b- change some hard evidence or targets // state <- OutdatedBNStructure 5- ie.makeInference(); // state <- Done 6- get posteriors 7- goto 2 or 4
BayesNetInference can be in one of 4 different states:
Definition at line 139 of file BayesNetInference.h.
|
strong |
current state of the inference
BayesNetInference can be in one of 4 different states:
Enumerator | |
---|---|
OutdatedBNStructure | |
OutdatedBNPotentials | |
ReadyForInference | |
Done |
Definition at line 180 of file BayesNetInference.h.
|
explicit |
default constructor
Definition at line 33 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__computeDomainSizes().
gum::BayesNetInference< GUM_SCALAR >::BayesNetInference | ( | ) |
default constructor with a null BN (useful for virtual inheritance)
Definition at line 44 of file BayesNetInference_tpl.h.
|
virtual |
destructor
Definition at line 51 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__evidence.
|
private |
computes the domain sizes of the random variables
Definition at line 158 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__bn, and gum::BayesNetInference< GUM_SCALAR >::__domain_sizes.
Referenced by gum::BayesNetInference< GUM_SCALAR >::__setBayesNetDuringConstruction(), gum::BayesNetInference< GUM_SCALAR >::BayesNetInference(), and gum::BayesNetInference< GUM_SCALAR >::setBN().
|
private |
create the internal structure for a hard evidence
Definition at line 183 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__bn, gum::MultiDimDecorator< GUM_SCALAR >::beginMultipleChanges(), gum::Instantiation::chgVal(), and GUM_ERROR.
Referenced by gum::BayesNetInference< GUM_SCALAR >::addEvidence(), and gum::BayesNetInference< GUM_SCALAR >::chgEvidence().
|
private |
checks whether a potential corresponds to a hard evidence or not
Definition at line 217 of file BayesNetInference_tpl.h.
References gum::Instantiation::end(), GUM_ERROR, gum::Instantiation::inc(), gum::Instantiation::setFirst(), and gum::Instantiation::val().
Referenced by gum::BayesNetInference< GUM_SCALAR >::addEvidence(), and gum::BayesNetInference< GUM_SCALAR >::chgEvidence().
|
private |
assigns a BN during the inference engine construction
Definition at line 140 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__bn, gum::BayesNetInference< GUM_SCALAR >::__computeDomainSizes(), gum::BayesNetInference< GUM_SCALAR >::__setState(), and gum::BayesNetInference< GUM_SCALAR >::OutdatedBNStructure.
Referenced by gum::EvidenceInference< GUM_SCALAR >::EvidenceInference(), gum::JointTargetedInference< GUM_SCALAR >::JointTargetedInference(), and gum::MarginalTargetedInference< GUM_SCALAR >::MarginalTargetedInference().
|
finalprivatevirtual |
set the state of the inference engine and call the notification _onStateChanged when necessary (i.e. when the state has effectively changed).
Definition at line 108 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__state, gum::BayesNetInference< GUM_SCALAR >::_onStateChanged(), and gum::BayesNetInference< GUM_SCALAR >::state().
Referenced by gum::BayesNetInference< GUM_SCALAR >::__setBayesNetDuringConstruction(), gum::BayesNetInference< GUM_SCALAR >::_setOutdatedBNPotentialsState(), gum::BayesNetInference< GUM_SCALAR >::_setOutdatedBNStructureState(), gum::MarginalTargetedInference< GUM_SCALAR >::addAllTargets(), gum::BayesNetInference< GUM_SCALAR >::addEvidence(), gum::JointTargetedInference< GUM_SCALAR >::addJointTarget(), gum::MarginalTargetedInference< GUM_SCALAR >::addTarget(), gum::BayesNetInference< GUM_SCALAR >::chgEvidence(), gum::BayesNetInference< GUM_SCALAR >::clear(), gum::BayesNetInference< GUM_SCALAR >::eraseAllEvidence(), gum::JointTargetedInference< GUM_SCALAR >::eraseAllJointTargets(), gum::MarginalTargetedInference< GUM_SCALAR >::eraseAllTargets(), gum::BayesNetInference< GUM_SCALAR >::eraseEvidence(), gum::JointTargetedInference< GUM_SCALAR >::eraseJointTarget(), gum::MarginalTargetedInference< GUM_SCALAR >::eraseTarget(), gum::BayesNetInference< GUM_SCALAR >::makeInference(), gum::BayesNetInference< GUM_SCALAR >::prepareInference(), and gum::BayesNetInference< GUM_SCALAR >::setBN().
|
protectedpure virtual |
called when the inference has to be performed effectively
Once the inference is done, _fillPosterior can be called.
Implemented in gum::LazyPropagation< GUM_SCALAR >, gum::SamplingInference< GUM_SCALAR >, gum::VariableElimination< GUM_SCALAR >, gum::ShaferShenoyInference< GUM_SCALAR >, and gum::LoopyBeliefPropagation< GUM_SCALAR >.
Referenced by gum::BayesNetInference< GUM_SCALAR >::makeInference().
|
protectedpure virtual |
fired before all the evidence are erased
Implemented in gum::SamplingInference< GUM_SCALAR >, gum::LazyPropagation< GUM_SCALAR >, gum::VariableElimination< GUM_SCALAR >, gum::ShaferShenoyInference< GUM_SCALAR >, and gum::LoopyBeliefPropagation< GUM_SCALAR >.
Referenced by gum::BayesNetInference< GUM_SCALAR >::eraseAllEvidence().
|
protectedpure virtual |
fired after a new Bayes net has been assigned to the engine
Implemented in gum::JointTargetedInference< GUM_SCALAR >, gum::SamplingInference< GUM_SCALAR >, gum::MarginalTargetedInference< GUM_SCALAR >, gum::LazyPropagation< GUM_SCALAR >, gum::VariableElimination< GUM_SCALAR >, gum::ShaferShenoyInference< GUM_SCALAR >, and gum::LoopyBeliefPropagation< GUM_SCALAR >.
Referenced by gum::BayesNetInference< GUM_SCALAR >::setBN().
|
protectedpure virtual |
fired after a new evidence is inserted
Implemented in gum::SamplingInference< GUM_SCALAR >, gum::LazyPropagation< GUM_SCALAR >, gum::VariableElimination< GUM_SCALAR >, gum::ShaferShenoyInference< GUM_SCALAR >, and gum::LoopyBeliefPropagation< GUM_SCALAR >.
Referenced by gum::BayesNetInference< GUM_SCALAR >::addEvidence().
|
protectedpure virtual |
fired after an evidence is changed, in particular when its status (soft/hard) changes
nodeId | the node of the changed evidence |
hasChangedSoftHard | true if the evidence has changed from Soft to Hard or from Hard to Soft |
Implemented in gum::SamplingInference< GUM_SCALAR >, gum::LazyPropagation< GUM_SCALAR >, gum::VariableElimination< GUM_SCALAR >, gum::ShaferShenoyInference< GUM_SCALAR >, and gum::LoopyBeliefPropagation< GUM_SCALAR >.
Referenced by gum::BayesNetInference< GUM_SCALAR >::chgEvidence().
|
protectedpure virtual |
fired before an evidence is removed
Implemented in gum::SamplingInference< GUM_SCALAR >, gum::LazyPropagation< GUM_SCALAR >, gum::VariableElimination< GUM_SCALAR >, gum::ShaferShenoyInference< GUM_SCALAR >, and gum::LoopyBeliefPropagation< GUM_SCALAR >.
Referenced by gum::BayesNetInference< GUM_SCALAR >::eraseEvidence().
|
protectedpure virtual |
fired when the stage is changed
Implemented in gum::SamplingInference< GUM_SCALAR >, gum::LazyPropagation< GUM_SCALAR >, gum::VariableElimination< GUM_SCALAR >, gum::ShaferShenoyInference< GUM_SCALAR >, and gum::LoopyBeliefPropagation< GUM_SCALAR >.
Referenced by gum::BayesNetInference< GUM_SCALAR >::__setState().
|
protected |
puts the inference into an OutdatedBNPotentials state if it is not already in an OutdatedBNStructure state
OutdatedBNPotentials: in this state, the structure of the BN remains unchanged, only some potentials stored in it have changed. Therefore, the inference probably just needs to invalidate some already computed potentials to be ready. Only a light amount of preparation is needed to be able to perform inference.
Definition at line 682 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__setState(), and gum::BayesNetInference< GUM_SCALAR >::OutdatedBNPotentials.
|
protected |
put the inference into an outdated BN structure state
OutdatedBNStructure: in this state, the inference is fully unprepared to be applied because some events changed the "logical" structure of the BN: for instance a node received a hard evidence, which implies that its outgoing arcs can be removed from the BN, hence involving a structural change in the BN. As a consequence, the (incremental) inference (probably) needs a significant amount of preparation to be ready for the next inference. In a Lazy propagation, for instance, this step amounts to compute a new join tree, hence a new structure in which inference will be applied. Note that classes that inherit from BayesNetInference may be smarter than BayesNetInference and may, in some situations, find out that their data structures are still ok for inference and, therefore, only resort to perform the actions related to the OutdatedBNPotentials state. As an example, consider a LazyPropagation inference in Bayes Net A->B->C->D->E in which C has received hard evidence e_C and E is the only target. In this case, A and B are not needed for inference, the only potentials that matter are P(D|e_C) and P(E|D). So the smallest join tree needed for inference contains only one clique DE. Now, adding new evidence e_A on A has no impact on E given hard evidence e_C. In this case, LazyPropagation can be smart and not update its join tree.
Definition at line 674 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__setState(), and gum::BayesNetInference< GUM_SCALAR >::OutdatedBNStructure.
|
protectedpure virtual |
prepares inference when the latter is in OutdatedBNPotentials state
Note that the values of evidence are not necessarily known and can be changed between _updateOutdatedBNPotentials and _makeInference.
Implemented in gum::SamplingInference< GUM_SCALAR >, gum::LazyPropagation< GUM_SCALAR >, gum::VariableElimination< GUM_SCALAR >, gum::ShaferShenoyInference< GUM_SCALAR >, and gum::LoopyBeliefPropagation< GUM_SCALAR >.
Referenced by gum::BayesNetInference< GUM_SCALAR >::prepareInference().
|
protectedpure virtual |
prepares inference when the latter is in OutdatedBNStructure state
Note that the values of evidence are not necessarily known and can be changed between _updateOutdatedBNStructure and _makeInference.
Implemented in gum::SamplingInference< GUM_SCALAR >, gum::LazyPropagation< GUM_SCALAR >, gum::VariableElimination< GUM_SCALAR >, gum::ShaferShenoyInference< GUM_SCALAR >, and gum::LoopyBeliefPropagation< GUM_SCALAR >.
Referenced by gum::BayesNetInference< GUM_SCALAR >::prepareInference().
|
finalvirtual |
adds a new hard evidence on node id
UndefinedElement | if id does not belong to the Bayesian network |
InvalidArgument | if val is not a value for id |
InvalidArgument | if id already has an evidence |
Definition at line 244 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__createHardEvidence().
Referenced by gum::LoopySamplingInference< GUM_SCALAR, APPROX >::_makeInference(), gum::BayesNetInference< GUM_SCALAR >::addEvidence(), gum::BayesNetInference< GUM_SCALAR >::addListOfEvidence(), gum::BayesNetInference< GUM_SCALAR >::addSetOfEvidence(), gum::MarginalTargetedInference< GUM_SCALAR >::evidenceImpact(), and gum::JointTargetedInference< GUM_SCALAR >::evidenceJointImpact().
|
finalvirtual |
adds a new hard evidence on node named nodeName
UndefinedElement | if nodeName does not belong to the Bayesian network |
InvalidArgument | if val is not a value for id |
InvalidArgument | if nodeName already has an evidence |
Definition at line 252 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::addEvidence(), and gum::BayesNetInference< GUM_SCALAR >::BN().
|
finalvirtual |
adds a new hard evidence on node id
UndefinedElement | if id does not belong to the Bayesian network |
InvalidArgument | if val is not a value for id |
InvalidArgument | if id already has an evidence |
Definition at line 260 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::addEvidence(), and gum::BayesNetInference< GUM_SCALAR >::BN().
|
finalvirtual |
adds a new hard evidence on node named nodeName
UndefinedElement | if nodeName does not belong to the Bayesian network |
InvalidArgument | if val is not a value for id |
InvalidArgument | if nodeName already has an evidence |
Definition at line 268 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::addEvidence(), and gum::BayesNetInference< GUM_SCALAR >::BN().
|
finalvirtual |
adds a new evidence on node id (might be soft or hard)
UndefinedElement | if id does not belong to the Bayesian network |
InvalidArgument | if id already has an evidence |
FatalError | if vals=[0,0,...,0] |
InvalidArgument | if the size of vals is different from the domain size of node id |
Definition at line 276 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__bn, gum::MultiDimDecorator< GUM_SCALAR >::add(), gum::BayesNetInference< GUM_SCALAR >::addEvidence(), and GUM_ERROR.
|
finalvirtual |
adds a new evidence on node named nodeName (might be soft or hard)
UndefinedElement | if id does not belong to the Bayesian network |
InvalidArgument | if nodeName already has an evidence |
FatalError | if vals=[0,0,...,0] |
InvalidArgument | if the size of vals is different from the domain size of node nodeName |
Definition at line 302 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::addEvidence(), and gum::BayesNetInference< GUM_SCALAR >::BN().
|
finalvirtual |
adds a new evidence on node id (might be soft or hard)
UndefinedElement | if the potential is defined over several nodes |
UndefinedElement | if the node on which the potential is defined does not belong to the Bayesian network |
InvalidArgument | if the node of the potential already has an evidence |
FatalError | if pot=[0,0,...,0] |
Definition at line 351 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::addEvidence().
|
finalvirtual |
adds a new evidence on node id (might be soft or hard)
UndefinedElement | if the potential is defined over several nodes |
UndefinedElement | if the node on which the potential is defined does not belong to the Bayesian network |
InvalidArgument | if the node of the potential already has an evidence |
FatalError | if pot=[0,0,...,0] |
Definition at line 310 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__bn, gum::BayesNetInference< GUM_SCALAR >::__evidence, gum::BayesNetInference< GUM_SCALAR >::__hard_evidence, gum::BayesNetInference< GUM_SCALAR >::__hard_evidence_nodes, gum::BayesNetInference< GUM_SCALAR >::__isHardEvidence(), gum::BayesNetInference< GUM_SCALAR >::__setState(), gum::BayesNetInference< GUM_SCALAR >::__soft_evidence_nodes, gum::BayesNetInference< GUM_SCALAR >::_onEvidenceAdded(), GUM_ERROR, gum::BayesNetInference< GUM_SCALAR >::hasEvidence(), gum::Set< Key, Alloc >::insert(), and gum::BayesNetInference< GUM_SCALAR >::OutdatedBNStructure.
|
finalvirtual |
adds a new list of evidence
UndefinedElement | if some potential is defined over several nodes |
UndefinedElement | if the node on which some potential is defined does not belong to the Bayesian network |
InvalidArgument | if the node of some potential already has an evidence |
FatalError | if pot=[0,0,...,0] |
Definition at line 360 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::addEvidence().
|
finalvirtual |
adds a new set of evidence
UndefinedElement | if some potential is defined over several nodes |
UndefinedElement | if the node on which some potential is defined does not belong to the Bayesian network |
InvalidArgument | if the node of some potential already has an evidence |
FatalError | if pot=[0,0,...,0] |
Definition at line 369 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::addEvidence().
|
finalvirtual |
Returns a constant reference over the IBayesNet referenced by this class.
UndefinedElement | is raised if no Bayes net has been assigned to the inference. |
Definition at line 118 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__bn, and GUM_ERROR.
Referenced by gum::WeightedSampling< GUM_SCALAR >::_draw(), gum::MonteCarloSampling< GUM_SCALAR >::_draw(), gum::ImportanceSampling< GUM_SCALAR >::_draw(), gum::SamplingInference< GUM_SCALAR >::_posterior(), gum::BayesNetInference< GUM_SCALAR >::addEvidence(), gum::BayesNetInference< GUM_SCALAR >::chgEvidence(), gum::SamplingInference< GUM_SCALAR >::contextualize(), gum::SamplingInference< GUM_SCALAR >::currentPosterior(), gum::BayesNetInference< GUM_SCALAR >::eraseEvidence(), gum::MarginalTargetedInference< GUM_SCALAR >::evidenceImpact(), gum::JointTargetedInference< GUM_SCALAR >::evidenceJointImpact(), gum::MarginalTargetedInference< GUM_SCALAR >::H(), gum::BayesNetInference< GUM_SCALAR >::hasEvidence(), gum::BayesNetInference< GUM_SCALAR >::hasHardEvidence(), gum::BayesNetInference< GUM_SCALAR >::hasSoftEvidence(), gum::JointTargetedInference< GUM_SCALAR >::I(), gum::JointTargetedInference< GUM_SCALAR >::jointMutualInformation(), gum::MarginalTargetedInference< GUM_SCALAR >::posterior(), gum::JointTargetedInference< GUM_SCALAR >::posterior(), gum::SamplingInference< GUM_SCALAR >::samplingBN(), and gum::Estimator< GUM_SCALAR >::setFromLBP().
|
finalvirtual |
change the value of an already existing hard evidence
UndefinedElement | if id does not belong to the Bayesian network |
InvalidArgument | if val is not a value for id |
InvalidArgument | if id does not already have an evidence |
Definition at line 429 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__createHardEvidence().
Referenced by gum::BayesNetInference< GUM_SCALAR >::chgEvidence(), gum::MarginalTargetedInference< GUM_SCALAR >::evidenceImpact(), and gum::JointTargetedInference< GUM_SCALAR >::evidenceJointImpact().
|
finalvirtual |
change the value of an already existing hard evidence
UndefinedElement | if nodeName does not belong to the Bayesian network |
InvalidArgument | if val is not a value for id |
InvalidArgument | if id does not already have an evidence |
Definition at line 437 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::BN(), and gum::BayesNetInference< GUM_SCALAR >::chgEvidence().
|
finalvirtual |
change the value of an already existing hard evidence
UndefinedElement | if id does not belong to the Bayesian network |
InvalidArgument | if val is not a value for id |
InvalidArgument | if id does not already have an evidence |
Definition at line 445 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::BN(), and gum::BayesNetInference< GUM_SCALAR >::chgEvidence().
|
finalvirtual |
change the value of an already existing hard evidence
UndefinedElement | if nodeName does not belong to the Bayesian network |
InvalidArgument | if val is not a value for id |
InvalidArgument | if id does not already have an evidence |
Definition at line 453 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::BN(), and gum::BayesNetInference< GUM_SCALAR >::chgEvidence().
|
finalvirtual |
change the value of an already existing evidence (might be soft or hard)
UndefinedElement | if id does not belong to the Bayesian network |
InvalidArgument | if the node does not already have an evidence |
FatalError | if vals=[0,0,...,0] |
InvalidArgument | if the size of vals is different from the domain size of node id |
Definition at line 461 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__bn, gum::MultiDimDecorator< GUM_SCALAR >::add(), gum::BayesNetInference< GUM_SCALAR >::chgEvidence(), and GUM_ERROR.
|
finalvirtual |
change the value of an already existing evidence (might be soft or hard)
UndefinedElement | if nodeName does not belong to the Bayesian network |
InvalidArgument | if the node does not already have an evidence |
FatalError | if vals=[0,0,...,0] |
InvalidArgument | if the size of vals is different from the domain size of node id |
Definition at line 488 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::BN(), and gum::BayesNetInference< GUM_SCALAR >::chgEvidence().
|
finalvirtual |
change the value of an already existing evidence (might be soft or hard)
UndefinedElement | if the potential is defined over several nodes |
UndefinedElement | if the node on which the potential is defined does not belong to the Bayesian network |
InvalidArgument | if the node of the potential does not already have an evidence |
FatalError | if pot=[0,0,...,0] |
Definition at line 496 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__bn, gum::BayesNetInference< GUM_SCALAR >::__evidence, gum::BayesNetInference< GUM_SCALAR >::__hard_evidence, gum::BayesNetInference< GUM_SCALAR >::__hard_evidence_nodes, gum::BayesNetInference< GUM_SCALAR >::__isHardEvidence(), gum::BayesNetInference< GUM_SCALAR >::__setState(), gum::BayesNetInference< GUM_SCALAR >::__soft_evidence_nodes, gum::BayesNetInference< GUM_SCALAR >::_onEvidenceChanged(), gum::Instantiation::end(), gum::Set< Key, Alloc >::erase(), GUM_ERROR, gum::BayesNetInference< GUM_SCALAR >::hasEvidence(), gum::BayesNetInference< GUM_SCALAR >::hasHardEvidence(), gum::Instantiation::inc(), gum::Set< Key, Alloc >::insert(), gum::BayesNetInference< GUM_SCALAR >::isInferenceOutdatedBNStructure(), gum::MultiDimDecorator< GUM_SCALAR >::nbrDim(), gum::BayesNetInference< GUM_SCALAR >::OutdatedBNPotentials, gum::BayesNetInference< GUM_SCALAR >::OutdatedBNStructure, gum::MultiDimDecorator< GUM_SCALAR >::set(), gum::Instantiation::setFirst(), and gum::MultiDimDecorator< GUM_SCALAR >::variable().
|
virtual |
clears all the data structures allocated for the last inference
Definition at line 150 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__setState(), gum::BayesNetInference< GUM_SCALAR >::eraseAllEvidence(), and gum::BayesNetInference< GUM_SCALAR >::OutdatedBNStructure.
Referenced by gum::BayesNetInference< GUM_SCALAR >::setBN().
|
finalvirtual |
get the domain sizes of the random variables of the BN
Definition at line 171 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__domain_sizes.
|
finalvirtual |
removes all the evidence entered into the network
Definition at line 592 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__evidence, gum::BayesNetInference< GUM_SCALAR >::__hard_evidence, gum::BayesNetInference< GUM_SCALAR >::__hard_evidence_nodes, gum::BayesNetInference< GUM_SCALAR >::__setState(), gum::BayesNetInference< GUM_SCALAR >::__soft_evidence_nodes, gum::BayesNetInference< GUM_SCALAR >::_onAllEvidenceErased(), gum::Set< Key, Alloc >::clear(), gum::BayesNetInference< GUM_SCALAR >::isInferenceOutdatedBNStructure(), gum::BayesNetInference< GUM_SCALAR >::OutdatedBNPotentials, and gum::BayesNetInference< GUM_SCALAR >::OutdatedBNStructure.
Referenced by gum::BayesNetInference< GUM_SCALAR >::clear(), gum::MarginalTargetedInference< GUM_SCALAR >::evidenceImpact(), gum::JointTargetedInference< GUM_SCALAR >::evidenceJointImpact(), and gum::JointTargetedInference< GUM_SCALAR >::jointMutualInformation().
|
finalvirtual |
removed the evidence, if any, corresponding to node id
Definition at line 563 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__evidence, gum::BayesNetInference< GUM_SCALAR >::__hard_evidence, gum::BayesNetInference< GUM_SCALAR >::__hard_evidence_nodes, gum::BayesNetInference< GUM_SCALAR >::__setState(), gum::BayesNetInference< GUM_SCALAR >::__soft_evidence_nodes, gum::BayesNetInference< GUM_SCALAR >::_onEvidenceErased(), gum::Set< Key, Alloc >::erase(), gum::BayesNetInference< GUM_SCALAR >::hasEvidence(), gum::BayesNetInference< GUM_SCALAR >::hasHardEvidence(), gum::BayesNetInference< GUM_SCALAR >::isInferenceOutdatedBNStructure(), gum::BayesNetInference< GUM_SCALAR >::OutdatedBNPotentials, and gum::BayesNetInference< GUM_SCALAR >::OutdatedBNStructure.
Referenced by gum::BayesNetInference< GUM_SCALAR >::eraseEvidence().
|
finalvirtual |
removed the evidence, if any, corresponding to node of name nodeName
Definition at line 585 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::BN(), and gum::BayesNetInference< GUM_SCALAR >::eraseEvidence().
INLINE const NodeProperty< const Potential< GUM_SCALAR > *> & gum::BayesNetInference< GUM_SCALAR >::evidence | ( | ) | const |
returns the set of evidence
Definition at line 647 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__evidence.
Referenced by gum::ImportanceSampling< GUM_SCALAR >::_onContextualize(), and gum::MarginalTargetedInference< GUM_SCALAR >::posterior().
INLINE const NodeProperty< Idx > & gum::BayesNetInference< GUM_SCALAR >::hardEvidence | ( | ) | const |
indicate for each node with hard evidence which value it took
Definition at line 639 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__hard_evidence.
Referenced by gum::WeightedSampling< GUM_SCALAR >::_draw(), gum::MonteCarloSampling< GUM_SCALAR >::_draw(), gum::ImportanceSampling< GUM_SCALAR >::_draw(), and gum::SamplingInference< GUM_SCALAR >::contextualize().
INLINE const NodeSet & gum::BayesNetInference< GUM_SCALAR >::hardEvidenceNodes | ( | ) | const |
returns the set of nodes with hard evidence
the set of nodes that received hard evidence
Definition at line 663 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__hard_evidence_nodes.
Referenced by gum::WeightedSampling< GUM_SCALAR >::_draw(), gum::MonteCarloSampling< GUM_SCALAR >::_draw(), gum::ImportanceSampling< GUM_SCALAR >::_draw(), gum::ImportanceSampling< GUM_SCALAR >::_onContextualize(), gum::SamplingInference< GUM_SCALAR >::_setEstimatorFromBN(), gum::SamplingInference< GUM_SCALAR >::_setEstimatorFromLBP(), gum::SamplingInference< GUM_SCALAR >::contextualize(), and gum::MarginalTargetedInference< GUM_SCALAR >::posterior().
|
finalvirtual |
indicates whether some node(s) have received evidence
Definition at line 378 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__evidence.
Referenced by gum::BayesNetInference< GUM_SCALAR >::addEvidence(), gum::BayesNetInference< GUM_SCALAR >::chgEvidence(), gum::BayesNetInference< GUM_SCALAR >::eraseEvidence(), and gum::BayesNetInference< GUM_SCALAR >::hasEvidence().
|
finalvirtual |
indicates whether node id has received an evidence
Definition at line 385 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__evidence.
|
finalvirtual |
indicates whether node id has received an evidence
Definition at line 406 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::BN(), and gum::BayesNetInference< GUM_SCALAR >::hasEvidence().
|
finalvirtual |
indicates whether node id has received a hard evidence
Definition at line 392 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__hard_evidence_nodes, and gum::Set< Key, Alloc >::exists().
Referenced by gum::ImportanceSampling< GUM_SCALAR >::_draw(), gum::BayesNetInference< GUM_SCALAR >::chgEvidence(), gum::BayesNetInference< GUM_SCALAR >::eraseEvidence(), and gum::BayesNetInference< GUM_SCALAR >::hasHardEvidence().
|
finalvirtual |
indicates whether node id has received a hard evidence
Definition at line 414 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::BN(), and gum::BayesNetInference< GUM_SCALAR >::hasHardEvidence().
|
finalvirtual |
indicates whether node id has received a soft evidence
Definition at line 399 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__soft_evidence_nodes, and gum::Set< Key, Alloc >::exists().
Referenced by gum::BayesNetInference< GUM_SCALAR >::hasSoftEvidence().
|
finalvirtual |
indicates whether node id has received a soft evidence
Definition at line 422 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::BN(), and gum::BayesNetInference< GUM_SCALAR >::hasSoftEvidence().
|
finalvirtualnoexcept |
returns whether the inference object is in a done state
The inference object is in a done state when the posteriors can be retrieved without performing a new inference, i.e., all the heavy computations have already been performed. Typically, in a junction tree algorithm, this corresponds to a situation in which all the messages needed in the JT have been computed and sent.
Definition at line 93 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__state, and gum::BayesNetInference< GUM_SCALAR >::Done.
Referenced by gum::JointTargetedInference< GUM_SCALAR >::jointPosterior(), gum::BayesNetInference< GUM_SCALAR >::makeInference(), gum::MarginalTargetedInference< GUM_SCALAR >::posterior(), and gum::BayesNetInference< GUM_SCALAR >::prepareInference().
|
finalvirtualnoexcept |
returns whether the inference object is in a InferenceDone state
Definition at line 86 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__state, and gum::BayesNetInference< GUM_SCALAR >::Done.
|
finalvirtualnoexcept |
returns whether the inference object is in a OutdatedBNPotential state
Definition at line 80 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__state, and gum::BayesNetInference< GUM_SCALAR >::OutdatedBNPotentials.
|
finalvirtualnoexcept |
returns whether the inference object is in a OutdatedBNStructure state
Definition at line 73 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__state, and gum::BayesNetInference< GUM_SCALAR >::OutdatedBNStructure.
Referenced by gum::BayesNetInference< GUM_SCALAR >::chgEvidence(), gum::BayesNetInference< GUM_SCALAR >::eraseAllEvidence(), and gum::BayesNetInference< GUM_SCALAR >::eraseEvidence().
|
finalvirtualnoexcept |
returns whether the inference object is in a ready state
Definition at line 67 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__state, and gum::BayesNetInference< GUM_SCALAR >::ReadyForInference.
Referenced by gum::SamplingInference< GUM_SCALAR >::_onStateChanged(), gum::BayesNetInference< GUM_SCALAR >::makeInference(), and gum::BayesNetInference< GUM_SCALAR >::prepareInference().
|
finalvirtual |
perform the heavy computations needed to compute the targets' posteriors
In a Junction tree propagation scheme, for instance, the heavy computations are those of the messages sent in the JT. This is precisely what makeInference should compute. Later, the computations of the posteriors can be done "lightly" by multiplying and projecting those messages.
Definition at line 708 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__setState(), gum::BayesNetInference< GUM_SCALAR >::_makeInference(), gum::BayesNetInference< GUM_SCALAR >::Done, gum::BayesNetInference< GUM_SCALAR >::isDone(), gum::BayesNetInference< GUM_SCALAR >::isInferenceReady(), and gum::BayesNetInference< GUM_SCALAR >::prepareInference().
Referenced by gum::LoopySamplingInference< GUM_SCALAR, APPROX >::_makeInference(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::disturbBN(), gum::MarginalTargetedInference< GUM_SCALAR >::evidenceImpact(), gum::JointTargetedInference< GUM_SCALAR >::evidenceJointImpact(), gum::JointTargetedInference< GUM_SCALAR >::jointMutualInformation(), gum::JointTargetedInference< GUM_SCALAR >::jointPosterior(), and gum::MarginalTargetedInference< GUM_SCALAR >::posterior().
|
finalvirtual |
returns the number of evidence entered into the Bayesian network
Definition at line 617 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__evidence.
|
finalvirtual |
returns the number of hard evidence entered into the Bayesian network
Definition at line 624 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__hard_evidence_nodes, and gum::Set< Key, Alloc >::size().
|
finalvirtual |
returns the number of soft evidence entered into the Bayesian network
Definition at line 631 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__soft_evidence_nodes, and gum::Set< Key, Alloc >::size().
|
finalvirtual |
prepare the internal inference structures for the next inference
Definition at line 689 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__bn, gum::BayesNetInference< GUM_SCALAR >::__setState(), gum::BayesNetInference< GUM_SCALAR >::__state, gum::BayesNetInference< GUM_SCALAR >::_updateOutdatedBNPotentials(), gum::BayesNetInference< GUM_SCALAR >::_updateOutdatedBNStructure(), GUM_ERROR, gum::BayesNetInference< GUM_SCALAR >::isDone(), gum::BayesNetInference< GUM_SCALAR >::isInferenceReady(), gum::BayesNetInference< GUM_SCALAR >::OutdatedBNStructure, and gum::BayesNetInference< GUM_SCALAR >::ReadyForInference.
Referenced by gum::BayesNetInference< GUM_SCALAR >::makeInference(), and gum::SamplingInference< GUM_SCALAR >::samplingBN().
|
virtual |
assigns a new BN to the inference engine
Assigns a new BN to the BayesNetInference engine and sends messages to the descendants of BayesNetInference to inform them that the BN has changed.
Definition at line 129 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__bn, gum::BayesNetInference< GUM_SCALAR >::__computeDomainSizes(), gum::BayesNetInference< GUM_SCALAR >::__setState(), gum::BayesNetInference< GUM_SCALAR >::_onBayesNetChanged(), gum::BayesNetInference< GUM_SCALAR >::clear(), and gum::BayesNetInference< GUM_SCALAR >::OutdatedBNStructure.
INLINE const NodeSet & gum::BayesNetInference< GUM_SCALAR >::softEvidenceNodes | ( | ) | const |
returns the set of nodes with soft evidence
the set of nodes that received soft evidence
Definition at line 655 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__soft_evidence_nodes.
Referenced by gum::SamplingInference< GUM_SCALAR >::contextualize().
|
finalvirtualnoexcept |
returns the state of the inference engine
Definition at line 101 of file BayesNetInference_tpl.h.
References gum::BayesNetInference< GUM_SCALAR >::__state.
Referenced by gum::BayesNetInference< GUM_SCALAR >::__setState().
|
private |
the Bayes net on which we perform inferences
Definition at line 580 of file BayesNetInference.h.
Referenced by gum::BayesNetInference< GUM_SCALAR >::__computeDomainSizes(), gum::BayesNetInference< GUM_SCALAR >::__createHardEvidence(), gum::MarginalTargetedInference< GUM_SCALAR >::__setAllMarginalTargets(), gum::BayesNetInference< GUM_SCALAR >::__setBayesNetDuringConstruction(), gum::MarginalTargetedInference< GUM_SCALAR >::addAllTargets(), gum::BayesNetInference< GUM_SCALAR >::addEvidence(), gum::JointTargetedInference< GUM_SCALAR >::addJointTarget(), gum::MarginalTargetedInference< GUM_SCALAR >::addTarget(), gum::BayesNetInference< GUM_SCALAR >::BN(), gum::BayesNetInference< GUM_SCALAR >::chgEvidence(), gum::JointTargetedInference< GUM_SCALAR >::eraseJointTarget(), gum::MarginalTargetedInference< GUM_SCALAR >::eraseTarget(), gum::EvidenceInference< GUM_SCALAR >::EvidenceInference(), gum::JointTargetedInference< GUM_SCALAR >::isJointTarget(), gum::MarginalTargetedInference< GUM_SCALAR >::isTarget(), gum::JointTargetedInference< GUM_SCALAR >::JointTargetedInference(), gum::MarginalTargetedInference< GUM_SCALAR >::MarginalTargetedInference(), gum::BayesNetInference< GUM_SCALAR >::prepareInference(), and gum::BayesNetInference< GUM_SCALAR >::setBN().
|
private |
the domain sizes of the random variables
Definition at line 583 of file BayesNetInference.h.
Referenced by gum::BayesNetInference< GUM_SCALAR >::__computeDomainSizes(), and gum::BayesNetInference< GUM_SCALAR >::domainSizes().
|
private |
the set of evidence entered into the network
Definition at line 586 of file BayesNetInference.h.
Referenced by gum::BayesNetInference< GUM_SCALAR >::addEvidence(), gum::BayesNetInference< GUM_SCALAR >::chgEvidence(), gum::BayesNetInference< GUM_SCALAR >::eraseAllEvidence(), gum::BayesNetInference< GUM_SCALAR >::eraseEvidence(), gum::BayesNetInference< GUM_SCALAR >::evidence(), gum::BayesNetInference< GUM_SCALAR >::hasEvidence(), gum::BayesNetInference< GUM_SCALAR >::nbrEvidence(), and gum::BayesNetInference< GUM_SCALAR >::~BayesNetInference().
|
private |
assign to each node with a hard evidence the index of its observed value
Definition at line 589 of file BayesNetInference.h.
Referenced by gum::BayesNetInference< GUM_SCALAR >::addEvidence(), gum::BayesNetInference< GUM_SCALAR >::chgEvidence(), gum::BayesNetInference< GUM_SCALAR >::eraseAllEvidence(), gum::BayesNetInference< GUM_SCALAR >::eraseEvidence(), and gum::BayesNetInference< GUM_SCALAR >::hardEvidence().
|
private |
the set of nodes that received hard evidence
Definition at line 595 of file BayesNetInference.h.
Referenced by gum::BayesNetInference< GUM_SCALAR >::addEvidence(), gum::BayesNetInference< GUM_SCALAR >::chgEvidence(), gum::BayesNetInference< GUM_SCALAR >::eraseAllEvidence(), gum::BayesNetInference< GUM_SCALAR >::eraseEvidence(), gum::BayesNetInference< GUM_SCALAR >::hardEvidenceNodes(), gum::BayesNetInference< GUM_SCALAR >::hasHardEvidence(), and gum::BayesNetInference< GUM_SCALAR >::nbrHardEvidence().
|
private |
the set of nodes that received soft evidence
Definition at line 592 of file BayesNetInference.h.
Referenced by gum::BayesNetInference< GUM_SCALAR >::addEvidence(), gum::BayesNetInference< GUM_SCALAR >::chgEvidence(), gum::BayesNetInference< GUM_SCALAR >::eraseAllEvidence(), gum::BayesNetInference< GUM_SCALAR >::eraseEvidence(), gum::BayesNetInference< GUM_SCALAR >::hasSoftEvidence(), gum::BayesNetInference< GUM_SCALAR >::nbrSoftEvidence(), and gum::BayesNetInference< GUM_SCALAR >::softEvidenceNodes().
|
private |
the current state of the inference (outdated/ready/done)
Definition at line 577 of file BayesNetInference.h.
Referenced by gum::BayesNetInference< GUM_SCALAR >::__setState(), gum::BayesNetInference< GUM_SCALAR >::isDone(), gum::BayesNetInference< GUM_SCALAR >::isInferenceDone(), gum::BayesNetInference< GUM_SCALAR >::isInferenceOutdatedBNPotentials(), gum::BayesNetInference< GUM_SCALAR >::isInferenceOutdatedBNStructure(), gum::BayesNetInference< GUM_SCALAR >::isInferenceReady(), gum::BayesNetInference< GUM_SCALAR >::prepareInference(), and gum::BayesNetInference< GUM_SCALAR >::state().
|
private |
Definition at line 618 of file BayesNetInference.h.
|
private |
Definition at line 617 of file BayesNetInference.h.
|
private |
allow JointInference to access the single targets and inference states
Definition at line 616 of file BayesNetInference.h.