![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
#include <weightedSampling.h>
Public Attributes | |
Signaler3< Size, double, double > | onProgress |
Progression, error and time. More... | |
Signaler1< std::string > | onStop |
Criteria messageApproximationScheme. More... | |
Public Member Functions | |
WeightedSampling (const IBayesNet< GUM_SCALAR > *bn) | |
Default constructor. More... | |
~WeightedSampling () override | |
Destructor. More... | |
virtual void | contextualize () |
Simplifying the Bayesian network with relevance reasonning to lighten the computational charge. More... | |
Potential< GUM_SCALAR > | evidenceImpact (NodeId target, const NodeSet &evs) |
Create a gum::Potential for P(target|evs) (for all instanciation of target and evs) More... | |
Potential< GUM_SCALAR > | evidenceImpact (const std::string &target, const std::vector< std::string > &evs) |
Create a gum::Potential for P(target|evs) (for all instanciation of target and evs) More... | |
Constructors / Destructors | |
const Potential< GUM_SCALAR > & | currentPosterior (NodeId id) |
Computes and returns the actual estimation of the posterior of a node. More... | |
const Potential< GUM_SCALAR > & | currentPosterior (const std::string &name) |
Computes and returns the actual estimation of the posterior of a node by its name. More... | |
Probability computations | |
const IBayesNet< GUM_SCALAR > & | samplingBN () |
get the BayesNet which is used to really perform the sampling More... | |
const Potential< GUM_SCALAR > & | posterior_ (NodeId id) override |
Computes and returns the posterior of a node. More... | |
Estimator objects initializing | |
virtual void | setEstimatorFromBN_ () |
Initializes the estimators object linked to the simulation. More... | |
virtual void | setEstimatorFromLBP_ (LoopyBeliefPropagation< GUM_SCALAR > *lbp, GUM_SCALAR virtualLBPSize) |
Initializes the estimators object linked to the simulation. More... | |
Probability computations | |
virtual const Potential< GUM_SCALAR > & | posterior (NodeId node) |
Computes and returns the posterior of a node. More... | |
virtual const Potential< GUM_SCALAR > & | posterior (const std::string &nodeName) |
Computes and returns the posterior of a node. More... | |
Targets | |
virtual void | eraseAllTargets () |
Clear all previously defined targets. More... | |
virtual void | addAllTargets () final |
adds all nodes as targets More... | |
virtual void | addTarget (NodeId target) final |
Add a marginal target to the list of targets. More... | |
virtual void | addTarget (const std::string &nodeName) final |
Add a marginal target to the list of targets. More... | |
virtual void | eraseTarget (NodeId target) final |
removes an existing (marginal) target More... | |
virtual void | eraseTarget (const std::string &nodeName) final |
removes an existing (marginal) target More... | |
virtual bool | isTarget (NodeId node) const final |
return true if variable is a (marginal) target More... | |
virtual bool | isTarget (const std::string &nodeName) const final |
return true if variable is a (marginal) target More... | |
virtual const Size | nbrTargets () const noexcept final |
returns the number of marginal targets More... | |
virtual const NodeSet & | targets () const noexcept final |
returns the list of marginal targets More... | |
Information Theory related functions | |
virtual GUM_SCALAR | H (NodeId X) final |
Entropy Compute Shanon's entropy of a node given the observation. More... | |
virtual GUM_SCALAR | H (const std::string &nodeName) final |
Entropy Compute Shanon's entropy of a node given the observation. 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... | |
Accessors / Modifiers | |
virtual const GraphicalModel & | model () 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 model More... | |
virtual bool | isInferenceReady () const noexcept final |
returns whether the inference object is in a ready state More... | |
virtual bool | isInferenceOutdatedStructure () const noexcept final |
returns whether the inference object is in a OutdatedStructure state More... | |
virtual bool | isInferenceOutdatedPotentials () const noexcept final |
returns whether the inference object is in a OutdatedPotential state More... | |
virtual bool | isInferenceDone () const noexcept final |
returns whether the inference object is in a InferenceDone 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 | hasEvidence (const std::string &nodeName) 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 | hasHardEvidence (const std::string &nodeName) 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 | 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... | |
Getters and setters | |
void | setEpsilon (double eps) |
Given that we approximate f(t), stopping criterion on |f(t+1)-f(t)|. More... | |
double | epsilon () const |
Returns the value of epsilon. More... | |
void | disableEpsilon () |
Disable stopping criterion on epsilon. More... | |
void | enableEpsilon () |
Enable stopping criterion on epsilon. More... | |
bool | isEnabledEpsilon () const |
Returns true if stopping criterion on epsilon is enabled, false otherwise. More... | |
void | setMinEpsilonRate (double rate) |
Given that we approximate f(t), stopping criterion on d/dt(|f(t+1)-f(t)|). More... | |
double | minEpsilonRate () const |
Returns the value of the minimal epsilon rate. More... | |
void | disableMinEpsilonRate () |
Disable stopping criterion on epsilon rate. More... | |
void | enableMinEpsilonRate () |
Enable stopping criterion on epsilon rate. More... | |
bool | isEnabledMinEpsilonRate () const |
Returns true if stopping criterion on epsilon rate is enabled, false otherwise. More... | |
void | setMaxIter (Size max) |
Stopping criterion on number of iterations. More... | |
Size | maxIter () const |
Returns the criterion on number of iterations. More... | |
void | disableMaxIter () |
Disable stopping criterion on max iterations. More... | |
void | enableMaxIter () |
Enable stopping criterion on max iterations. More... | |
bool | isEnabledMaxIter () const |
Returns true if stopping criterion on max iterations is enabled, false otherwise. More... | |
void | setMaxTime (double timeout) |
Stopping criterion on timeout. More... | |
double | maxTime () const |
Returns the timeout (in seconds). More... | |
double | currentTime () const |
Returns the current running time in second. More... | |
void | disableMaxTime () |
Disable stopping criterion on timeout. More... | |
void | enableMaxTime () |
Enable stopping criterion on timeout. More... | |
bool | isEnabledMaxTime () const |
Returns true if stopping criterion on timeout is enabled, false otherwise. More... | |
void | setPeriodSize (Size p) |
How many samples between two stopping is enable. More... | |
Size | periodSize () const |
Returns the period size. More... | |
void | setVerbosity (bool v) |
Set the verbosity on (true) or off (false). More... | |
bool | verbosity () const |
Returns true if verbosity is enabled. More... | |
ApproximationSchemeSTATE | stateApproximationScheme () const |
Returns the approximation scheme state. More... | |
Size | nbrIterations () const |
Returns the number of iterations. More... | |
const std::vector< double > & | history () const |
Returns the scheme history. More... | |
void | initApproximationScheme () |
Initialise the scheme. More... | |
bool | startOfPeriod () |
Returns true if we are at the beginning of a period (compute error is mandatory). More... | |
void | updateApproximationScheme (unsigned int incr=1) |
Update the scheme w.r.t the new error and increment steps. More... | |
Size | remainingBurnIn () |
Returns the remaining burn in. More... | |
void | stopApproximationScheme () |
Stop the approximation scheme. More... | |
bool | continueApproximationScheme (double error) |
Update the scheme w.r.t the new error. More... | |
Getters and setters | |
std::string | messageApproximationScheme () const |
Returns the approximation scheme message. More... | |
Public Types | |
enum | StateOfInference { StateOfInference::OutdatedStructure, StateOfInference::OutdatedPotentials, StateOfInference::ReadyForInference, StateOfInference::Done } |
current state of the inference More... | |
enum | ApproximationSchemeSTATE : char { ApproximationSchemeSTATE::Undefined, ApproximationSchemeSTATE::Continue, ApproximationSchemeSTATE::Epsilon, ApproximationSchemeSTATE::Rate, ApproximationSchemeSTATE::Limit, ApproximationSchemeSTATE::TimeLimit, ApproximationSchemeSTATE::Stopped } |
The different state of an approximation scheme. More... | |
Protected Attributes | |
Estimator< GUM_SCALAR > | _estimator_ |
Estimator object designed to approximate target posteriors. More... | |
bool | isSetEstimator = false |
whether the Estimator object has been initialized More... | |
bool | isContextualized = false |
whether the referenced Bayesian network has been "contextualized" More... | |
double | current_epsilon_ |
Current epsilon. More... | |
double | last_epsilon_ |
Last epsilon value. More... | |
double | current_rate_ |
Current rate. More... | |
Size | current_step_ |
The current step. More... | |
Timer | timer_ |
The timer. More... | |
ApproximationSchemeSTATE | current_state_ |
The current state. More... | |
std::vector< double > | history_ |
The scheme history, used only if verbosity == true. More... | |
double | eps_ |
Threshold for convergence. More... | |
bool | enabled_eps_ |
If true, the threshold convergence is enabled. More... | |
double | min_rate_eps_ |
Threshold for the epsilon rate. More... | |
bool | enabled_min_rate_eps_ |
If true, the minimal threshold for epsilon rate is enabled. More... | |
double | max_time_ |
The timeout. More... | |
bool | enabled_max_time_ |
If true, the timeout is enabled. More... | |
Size | max_iter_ |
The maximum iterations. More... | |
bool | enabled_max_iter_ |
If true, the maximum iterations stopping criterion is enabled. More... | |
Size | burn_in_ |
Number of iterations before checking stopping criteria. More... | |
Size | period_size_ |
Checking criteria frequency. More... | |
bool | verbosity_ |
If true, verbosity is enabled. More... | |
Protected Member Functions | |
Instantiation | burnIn_ () override |
draws a defined number of samples without updating the estimators More... | |
Instantiation | draw_ (GUM_SCALAR *w, Instantiation prev) override |
draws a sample according to Weighted sampling More... | |
void | makeInference_ () override |
makes the inference by generating samples More... | |
void | loopApproxInference_ () |
virtual void | addVarSample_ (NodeId nod, Instantiation *I) |
adds a node to current instantiation More... | |
virtual void | onContextualize_ (BayesNetFragment< GUM_SCALAR > *bn) |
fired when Bayesian network is contextualized More... | |
void | onEvidenceAdded_ (const NodeId id, bool isHardEvidence) override |
fired after a new evidence is inserted More... | |
void | onEvidenceErased_ (const NodeId id, bool isHardEvidence) override |
fired before an evidence is removed More... | |
void | onAllEvidenceErased_ (bool contains_hard_evidence) override |
fired before all the evidence are erased More... | |
void | onEvidenceChanged_ (const NodeId id, bool hasChangedSoftHard) override |
fired after an evidence is changed, in particular when its status (soft/hard) changes More... | |
void | onModelChanged_ (const GraphicalModel *bn) override |
fired after a new Bayes net has been assigned to the engine More... | |
void | updateOutdatedStructure_ () override |
prepares inference when the latter is in OutdatedStructure state More... | |
void | updateOutdatedPotentials_ () override |
prepares inference when the latter is in OutdatedPotentials state More... | |
void | onMarginalTargetAdded_ (const NodeId id) override |
fired after a new marginal target is inserted More... | |
void | onMarginalTargetErased_ (const NodeId id) override |
fired before a marginal target is removed More... | |
void | onAllMarginalTargetsAdded_ () override |
fired after all the nodes of the BN are added as marginal targets More... | |
void | onAllMarginalTargetsErased_ () override |
fired before a all marginal targets are removed More... | |
void | onStateChanged_ () override |
fired when the stage is changed More... | |
void | setTargetedMode_ () |
bool | isTargetedMode_ () const |
void | setOutdatedStructureState_ () |
put the inference into an outdated model structure state More... | |
void | setOutdatedPotentialsState_ () |
puts the inference into an OutdatedPotentials state if it is not already in an OutdatedStructure state More... | |
virtual void | setState_ (const StateOfInference state) final |
set the state of the inference engine and call the notification onStateChanged_ when necessary (i.e. when the state has effectively changed). More... | |
void | setModel_ (const GraphicalModel *model) |
void | setModelDuringConstruction_ (const GraphicalModel *model) |
assigns a model during the inference engine construction More... | |
bool | hasNoModel_ () const |
Definition at line 50 of file weightedSampling.h.
|
stronginherited |
The different state of an approximation scheme.
Enumerator | |
---|---|
Undefined | |
Continue | |
Epsilon | |
Rate | |
Limit | |
TimeLimit | |
Stopped |
Definition at line 64 of file IApproximationSchemeConfiguration.h.
|
stronginherited |
current state of the inference
graphicalModelInference can be in one of 4 different states:
Enumerator | |
---|---|
OutdatedStructure | |
OutdatedPotentials | |
ReadyForInference | |
Done |
Definition at line 106 of file graphicalModelInference.h.
|
explicit |
Default constructor.
Definition at line 38 of file weightedSampling_tpl.h.
|
override |
Destructor.
Definition at line 46 of file weightedSampling_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
adds all nodes as targets
Definition at line 130 of file marginalTargetedInference_tpl.h.
|
finalvirtualinherited |
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 228 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 234 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 241 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 248 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 256 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 280 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 325 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 287 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 333 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 342 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
Add a marginal target to the list of targets.
UndefinedElement | if target is not a NodeId in the Bayes net |
Definition at line 107 of file marginalTargetedInference_tpl.h.
|
finalvirtualinherited |
Add a marginal target to the list of targets.
UndefinedElement | if target is not a NodeId in the Bayes net |
Definition at line 151 of file marginalTargetedInference_tpl.h.
|
protectedvirtualinherited |
adds a node to current instantiation
nod | the node to add to the sample |
I | the current sample |
generates random value based on the BN's CPT's and adds the node to the Instantiation with that value
Definition at line 180 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 57 of file BayesNetInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
overrideprotectedvirtual |
draws a defined number of samples without updating the estimators
No burn in needed for Weighted sampling.
Implements gum::SamplingInference< GUM_SCALAR >.
Definition at line 53 of file weightedSampling_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 402 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 408 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 415 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 422 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 431 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 456 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 464 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
clears all the data structures allocated for the last inference
Reimplemented in gum::ShaferShenoyLIMIDInference< GUM_SCALAR >.
Definition at line 139 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Simplifying the Bayesian network with relevance reasonning to lighten the computational charge.
Sets the reference Bayesian network as a BayesNetFragment after having eliminated nodes that are idle for simulation and computation, such as barren or d-separated nodes. Eliminates the arcs from evidence nodes to it's children, after setting new CPT's for them.
Definition at line 109 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
Update the scheme w.r.t the new error.
Test the stopping criterion that are enabled.
error | The new error value. |
OperationNotAllowed | Raised if state != ApproximationSchemeSTATE::Continue. |
Definition at line 208 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
Computes and returns the actual estimation of the posterior of a node.
id | the node for which we need a posterior probability |
UndefinedElement | if node is not in the set of targets. |
NotFound | if node is not in the BN. |
Definition at line 93 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
Computes and returns the actual estimation of the posterior of a node by its name.
name | the name of the node for which we need a posterior probability |
UndefinedElement | if node corresponding to name is not in the set of targets. |
NotFound | if node corresponding to name is not in the BN. |
Definition at line 99 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns the current running time in second.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 115 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Disable stopping criterion on epsilon.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 53 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Disable stopping criterion on max iterations.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 94 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Disable stopping criterion on timeout.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 118 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Disable stopping criterion on epsilon rate.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 74 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
get the domain sizes of the random variables of the model
Definition at line 159 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
overrideprotectedvirtual |
draws a sample according to Weighted sampling
w | the weight of sample being generated |
prev | the previous sample generated |
bn | the Bayesian network containing the evidence |
hardEvNodes | hard evidence nodes |
hardEv | hard evidences values |
Generates a new sample in topological order. Each sample has a weight bias. The sample weight is the product of each node's weight.
Implements gum::SamplingInference< GUM_SCALAR >.
Definition at line 60 of file weightedSampling_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Enable stopping criterion on epsilon.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 56 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Enable stopping criterion on max iterations.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 97 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Enable stopping criterion on timeout.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 121 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Enable stopping criterion on epsilon rate.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 77 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns the value of epsilon.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 50 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
removes all the evidence entered into the network
Definition at line 553 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Clear all previously defined targets.
Reimplemented in gum::JointTargetedInference< GUM_SCALAR >.
Definition at line 95 of file marginalTargetedInference_tpl.h.
|
finalvirtualinherited |
removed the evidence, if any, corresponding to node id
Definition at line 527 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
removed the evidence, if any, corresponding to node of name nodeName
Definition at line 546 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
removes an existing (marginal) target
Definition at line 164 of file marginalTargetedInference_tpl.h.
|
finalvirtualinherited |
removes an existing (marginal) target
Definition at line 188 of file marginalTargetedInference_tpl.h.
|
inherited |
returns the set of evidence
Definition at line 605 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
Create a gum::Potential for P(target|evs) (for all instanciation of target and evs)
bn | the BayesNet |
target | the nodeId of the targetted variable |
evs | the vector of nodeId of the observed variables |
Definition at line 268 of file marginalTargetedInference_tpl.h.
|
inherited |
Create a gum::Potential for P(target|evs) (for all instanciation of target and evs)
target | the nodeId of the target variable |
evs | the nodeId of the observed variable |
Definition at line 306 of file marginalTargetedInference_tpl.h.
|
finalvirtualinherited |
Entropy Compute Shanon's entropy of a node given the observation.
Definition at line 253 of file marginalTargetedInference_tpl.h.
|
finalvirtualinherited |
Entropy Compute Shanon's entropy of a node given the observation.
Definition at line 261 of file marginalTargetedInference_tpl.h.
|
inherited |
indicate for each node with hard evidence which value it took
Definition at line 597 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
returns the set of nodes with hard evidence
the set of nodes that received hard evidence
Definition at line 619 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
indicates whether some node(s) have received evidence
Definition at line 351 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
indicates whether node id has received an evidence
Definition at line 358 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
indicates whether node id has received an evidence
Definition at line 380 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
indicates whether node id has received a hard evidence
Definition at line 365 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
indicates whether node id has received a hard evidence
Definition at line 388 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
inlineprotectedinherited |
Definition at line 527 of file graphicalModelInference.h.
|
finalvirtualinherited |
indicates whether node id has received a soft evidence
Definition at line 372 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
indicates whether node id has received a soft evidence
Definition at line 396 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns the scheme history.
OperationNotAllowed | Raised if the scheme did not performed or if verbosity is set to false. |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 157 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
Initialise the scheme.
Definition at line 168 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns true if stopping criterion on epsilon is enabled, false otherwise.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 60 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns true if stopping criterion on max iterations is enabled, false otherwise.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 101 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns true if stopping criterion on timeout is enabled, false otherwise.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 125 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns true if stopping criterion on epsilon rate is enabled, false otherwise.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 81 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualnoexceptinherited |
returns whether the inference object is in a InferenceDone 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 84 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualnoexceptinherited |
returns whether the inference object is in a OutdatedPotential state
Definition at line 79 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualnoexceptinherited |
returns whether the inference object is in a OutdatedStructure state
Definition at line 73 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualnoexceptinherited |
returns whether the inference object is in a ready state
Definition at line 68 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
return true if variable is a (marginal) target
Definition at line 73 of file marginalTargetedInference_tpl.h.
|
finalvirtualinherited |
return true if variable is a (marginal) target
Definition at line 88 of file marginalTargetedInference_tpl.h.
|
protectedinherited |
Definition at line 315 of file marginalTargetedInference_tpl.h.
|
protectedinherited |
Definition at line 159 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 664 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
overrideprotectedvirtualinherited |
makes the inference by generating samples
Implements gum::GraphicalModelInference< GUM_SCALAR >.
Definition at line 153 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns the criterion on number of iterations.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 91 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns the timeout (in seconds).
Implements gum::IApproximationSchemeConfiguration.
Definition at line 112 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
Returns the approximation scheme message.
Definition at line 38 of file IApproximationSchemeConfiguration_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns the value of the minimal epsilon rate.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 71 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
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 107 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
returns the number of evidence entered into the Bayesian network
Definition at line 576 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
returns the number of hard evidence entered into the Bayesian network
Definition at line 583 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns the number of iterations.
OperationNotAllowed | Raised if the scheme did not perform. |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 148 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
returns the number of soft evidence entered into the Bayesian network
Definition at line 590 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualnoexceptinherited |
returns the number of marginal targets
Definition at line 207 of file marginalTargetedInference_tpl.h.
|
overrideprotectedvirtualinherited |
fired before all the evidence are erased
Implements gum::GraphicalModelInference< GUM_SCALAR >.
Definition at line 202 of file samplingInference_tpl.h.
|
overrideprotectedvirtualinherited |
fired after all the nodes of the BN are added as marginal targets
Implements gum::MarginalTargetedInference< GUM_SCALAR >.
Definition at line 228 of file samplingInference_tpl.h.
|
overrideprotectedvirtualinherited |
fired before a all marginal targets are removed
Implements gum::MarginalTargetedInference< GUM_SCALAR >.
Definition at line 231 of file samplingInference_tpl.h.
|
protectedvirtualinherited |
fired when Bayesian network is contextualized
bn | the contextualized BayesNetFragment |
targets | inference target variables |
hardEvNodes | hard evidence nodes |
hardEv | hard evidences values |
Reimplemented in gum::ImportanceSampling< GUM_SCALAR >.
Definition at line 188 of file samplingInference_tpl.h.
|
overrideprotectedvirtualinherited |
fired after a new evidence is inserted
Implements gum::GraphicalModelInference< GUM_SCALAR >.
Definition at line 192 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
overrideprotectedvirtualinherited |
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 |
Implements gum::GraphicalModelInference< GUM_SCALAR >.
Definition at line 205 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
overrideprotectedvirtualinherited |
fired before an evidence is removed
Implements gum::GraphicalModelInference< GUM_SCALAR >.
Definition at line 199 of file samplingInference_tpl.h.
|
overrideprotectedvirtualinherited |
fired after a new marginal target is inserted
id | The target variable's id. |
Implements gum::MarginalTargetedInference< GUM_SCALAR >.
Definition at line 222 of file samplingInference_tpl.h.
|
overrideprotectedvirtualinherited |
fired before a marginal target is removed
id | The target variable's id. |
Implements gum::MarginalTargetedInference< GUM_SCALAR >.
Definition at line 225 of file samplingInference_tpl.h.
|
overrideprotectedvirtualinherited |
fired after a new Bayes net has been assigned to the engine
Reimplemented from gum::MarginalTargetedInference< GUM_SCALAR >.
Definition at line 213 of file samplingInference_tpl.h.
|
overrideprotectedvirtualinherited |
fired when the stage is changed
Implements gum::GraphicalModelInference< GUM_SCALAR >.
Definition at line 234 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns the period size.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 134 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Computes and returns the posterior of a node.
node | the node for which we need a posterior probability |
UndefinedElement | if node is not in the set of targets |
Reimplemented in gum::JointTargetedInference< GUM_SCALAR >.
Definition at line 229 of file marginalTargetedInference_tpl.h.
|
virtualinherited |
Computes and returns the posterior of a node.
nodeName | the anme of the node for which we need a posterior probability |
UndefinedElement | if node is not in the set of targets |
Reimplemented in gum::JointTargetedInference< GUM_SCALAR >.
Definition at line 245 of file marginalTargetedInference_tpl.h.
|
overridevirtualinherited |
Computes and returns the posterior of a node.
id | the node for which we need a posterior probability |
UndefinedElement | if node is not in the set of targets. |
NotFound | if node is not in the BN. |
Implements gum::MarginalTargetedInference< GUM_SCALAR >.
Definition at line 104 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualinherited |
prepare the internal inference structures for the next inference
Definition at line 645 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
Returns the remaining burn in.
Definition at line 191 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
get the BayesNet which is used to really perform the sampling
Definition at line 70 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
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 64 of file BayesNetInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Given that we approximate f(t), stopping criterion on |f(t+1)-f(t)|.
If the criterion was disabled it will be enabled.
eps | The new epsilon value. |
OutOfLowerBound | Raised if eps < 0. |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 42 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Initializes the estimators object linked to the simulation.
Initializes the estimator object by creating a hashtable between non evidence nodes and a 0-filled potential which will approximate the node's posterior
Definition at line 78 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Initializes the estimators object linked to the simulation.
lbp | a LoopyBeliefPropagation object |
virtualLBPSize | the size of the equivalent sampling by LBP |
Initializes the estimator object by creating a hashtable between non evidence nodes and the current approximation of the node's posterior obtained by running LoopyBeliefPropagation algorithm
Definition at line 84 of file samplingInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Stopping criterion on number of iterations.
If the criterion was disabled it will be enabled.
max | The maximum number of iterations. |
OutOfLowerBound | Raised if max <= 1. |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 84 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Stopping criterion on timeout.
If the criterion was disabled it will be enabled.
timeout | The timeout value in seconds. |
OutOfLowerBound | Raised if timeout <= 0.0. |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 105 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Given that we approximate f(t), stopping criterion on d/dt(|f(t+1)-f(t)|).
If the criterion was disabled it will be enabled
rate | The minimal epsilon rate. |
OutOfLowerBound | if rate<0 |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 63 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedinherited |
Definition at line 118 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedinherited |
assigns a model during the inference engine construction
Definition at line 129 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedinherited |
puts the inference into an OutdatedPotentials state if it is not already in an OutdatedStructure state
OutdatedPotentials: in this state, the structure of the model 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 638 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedinherited |
put the inference into an outdated model structure state
OutdatedStructure: in this state, the inference is fully unprepared to be applied because some events changed the "logical" structure of the model: for instance a node received a hard evidence, which implies that its outgoing arcs can be removed from the model, hence involving a structural change in the model. 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 graphicalModelInference may be smarter than graphicalModelInference 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 OutdatedPotentials 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 630 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
How many samples between two stopping is enable.
p | The new period value. |
OutOfLowerBound | Raised if p < 1. |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 128 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalprotectedvirtualinherited |
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 98 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedinherited |
Definition at line 319 of file marginalTargetedInference_tpl.h.
|
virtualinherited |
Set the verbosity on (true) or off (false).
v | If true, then verbosity is turned on. |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 137 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
returns the set of nodes with soft evidence
the set of nodes that received soft evidence
Definition at line 612 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
Returns true if we are at the beginning of a period (compute error is mandatory).
Definition at line 178 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualnoexceptinherited |
returns the state of the inference engine
Definition at line 92 of file graphicalModelInference_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
virtualinherited |
Returns the approximation scheme state.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 143 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
inherited |
Stop the approximation scheme.
Definition at line 200 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
finalvirtualnoexceptinherited |
returns the list of marginal targets
Definition at line 201 of file marginalTargetedInference_tpl.h.
|
inherited |
Update the scheme w.r.t the new error and increment steps.
incr | The new increment steps. |
Definition at line 187 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
overrideprotectedvirtualinherited |
prepares inference when the latter is in OutdatedPotentials state
Note that the values of evidence are not necessarily known and can be changed between updateOutdatedPotentials_ and makeInference_.
Implements gum::GraphicalModelInference< GUM_SCALAR >.
Definition at line 219 of file samplingInference_tpl.h.
|
overrideprotectedvirtualinherited |
prepares inference when the latter is in OutdatedStructure state
Note that the values of evidence are not necessarily known and can be changed between updateOutdatedStructure_ and makeInference_.
Implements gum::GraphicalModelInference< GUM_SCALAR >.
Definition at line 216 of file samplingInference_tpl.h.
|
virtualinherited |
Returns true if verbosity is enabled.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 139 of file approximationScheme_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
protectedinherited |
Estimator object designed to approximate target posteriors.
Definition at line 178 of file samplingInference.h.
|
protectedinherited |
Number of iterations before checking stopping criteria.
Definition at line 413 of file approximationScheme.h.
|
protectedinherited |
Current epsilon.
Definition at line 368 of file approximationScheme.h.
|
protectedinherited |
Current rate.
Definition at line 374 of file approximationScheme.h.
|
protectedinherited |
The current state.
Definition at line 383 of file approximationScheme.h.
|
protectedinherited |
The current step.
Definition at line 377 of file approximationScheme.h.
|
protectedinherited |
If true, the threshold convergence is enabled.
Definition at line 392 of file approximationScheme.h.
|
protectedinherited |
If true, the maximum iterations stopping criterion is enabled.
Definition at line 410 of file approximationScheme.h.
|
protectedinherited |
If true, the timeout is enabled.
Definition at line 404 of file approximationScheme.h.
|
protectedinherited |
If true, the minimal threshold for epsilon rate is enabled.
Definition at line 398 of file approximationScheme.h.
|
protectedinherited |
Threshold for convergence.
Definition at line 389 of file approximationScheme.h.
|
protectedinherited |
The scheme history, used only if verbosity == true.
Definition at line 386 of file approximationScheme.h.
|
protectedinherited |
whether the referenced Bayesian network has been "contextualized"
Definition at line 184 of file samplingInference.h.
|
protectedinherited |
whether the Estimator object has been initialized
Definition at line 181 of file samplingInference.h.
|
protectedinherited |
Last epsilon value.
Definition at line 371 of file approximationScheme.h.
|
protectedinherited |
The maximum iterations.
Definition at line 407 of file approximationScheme.h.
|
protectedinherited |
The timeout.
Definition at line 401 of file approximationScheme.h.
|
protectedinherited |
Threshold for the epsilon rate.
Definition at line 395 of file approximationScheme.h.
Progression, error and time.
Definition at line 58 of file IApproximationSchemeConfiguration.h.
|
inherited |
Criteria messageApproximationScheme.
Definition at line 61 of file IApproximationSchemeConfiguration.h.
|
protectedinherited |
Checking criteria frequency.
Definition at line 416 of file approximationScheme.h.
|
protectedinherited |
The timer.
Definition at line 380 of file approximationScheme.h.
|
protectedinherited |
If true, verbosity is enabled.
Definition at line 419 of file approximationScheme.h.