![]() |
aGrUM
0.16.0
|
<agrum/CN/CNLoopyPropagation.h> More...
#include <CNLoopyPropagation.h>
Public Attributes | |
Signaler3< Size, double, double > | onProgress |
Progression, error and time. More... | |
Signaler1< std::string > | onStop |
Criteria messageApproximationScheme. More... | |
Public Member Functions | |
virtual void | insertEvidenceFile (const std::string &path) |
Insert evidence from file. More... | |
Public algorithm methods | |
void | makeInference () |
Starts the inference. More... | |
Getters and setters | |
void | inferenceType (InferenceType inft) |
Set the inference type. More... | |
InferenceType | inferenceType () |
Get the inference type. More... | |
Post-inference methods | |
void | eraseAllEvidence () |
Erase all inference related data to perform another one. More... | |
void | saveInference (const std::string &path) |
Constructors / Destructors | |
CNLoopyPropagation (const CredalNet< GUM_SCALAR > &cnet) | |
Constructor. More... | |
virtual | ~CNLoopyPropagation () |
Destructor. More... | |
Getters and setters | |
VarMod2BNsMap< GUM_SCALAR > * | getVarMod2BNsMap () |
Get optimum IBayesNet. More... | |
const CredalNet< GUM_SCALAR > & | credalNet () |
Get this creadal network. More... | |
const NodeProperty< std::vector< NodeId > > & | getT0Cluster () const |
Get the _t0 cluster. More... | |
const NodeProperty< std::vector< NodeId > > & | getT1Cluster () const |
Get the _t1 cluster. More... | |
void | setRepetitiveInd (const bool repetitive) |
void | storeVertices (const bool value) |
bool | storeVertices () const |
Get the number of iterations without changes used to stop some algorithms. More... | |
void | storeBNOpt (const bool value) |
bool | storeBNOpt () const |
bool | repetitiveInd () const |
Get the current independence status. More... | |
Pre-inference initialization methods | |
void | insertModalsFile (const std::string &path) |
Insert variables modalities from file to compute expectations. More... | |
void | insertModals (const std::map< std::string, std::vector< GUM_SCALAR > > &modals) |
Insert variables modalities from map to compute expectations. More... | |
void | insertEvidence (const std::map< std::string, std::vector< GUM_SCALAR > > &eviMap) |
Insert evidence from map. More... | |
void | insertEvidence (const NodeProperty< std::vector< GUM_SCALAR > > &evidence) |
Insert evidence from Property. More... | |
void | insertQueryFile (const std::string &path) |
Insert query variables states from file. More... | |
void | insertQuery (const NodeProperty< std::vector< bool > > &query) |
Insert query variables and states from Property. More... | |
Post-inference methods | |
const std::vector< GUM_SCALAR > & | marginalMin (const NodeId id) const |
Get the lower marginals of a given node id. More... | |
const std::vector< GUM_SCALAR > & | marginalMin (const std::string &varName) const |
Get the lower marginals of a given variable name. More... | |
const std::vector< GUM_SCALAR > & | marginalMax (const NodeId id) const |
Get the upper marginals of a given node id. More... | |
const std::vector< GUM_SCALAR > & | marginalMax (const std::string &varName) const |
Get the upper marginals of a given variable name. More... | |
const GUM_SCALAR & | expectationMin (const NodeId id) const |
Get the lower expectation of a given node id. More... | |
const GUM_SCALAR & | expectationMin (const std::string &varName) const |
Get the lower expectation of a given variable name. More... | |
const GUM_SCALAR & | expectationMax (const NodeId id) const |
Get the upper expectation of a given node id. More... | |
const GUM_SCALAR & | expectationMax (const std::string &varName) const |
Get the upper expectation of a given variable name. More... | |
const std::vector< GUM_SCALAR > & | dynamicExpMin (const std::string &varName) const |
Get the lower dynamic expectation of a given variable prefix (without the time step included, i.e. More... | |
const std::vector< GUM_SCALAR > & | dynamicExpMax (const std::string &varName) const |
Get the upper dynamic expectation of a given variable prefix (without the time step included, i.e. More... | |
const std::vector< std::vector< GUM_SCALAR > > & | vertices (const NodeId id) const |
Get the vertice of a given node id. More... | |
void | saveMarginals (const std::string &path) const |
Saves marginals to file. More... | |
void | saveExpectations (const std::string &path) const |
Saves expectations to file. More... | |
void | saveVertices (const std::string &path) const |
Saves vertices to file. More... | |
void | dynamicExpectations () |
Compute dynamic expectations. More... | |
std::string | toString () const |
Print all nodes marginals to standart output. More... | |
const std::string | getApproximationSchemeMsg () |
Get approximation scheme state. 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 | InferenceType : char { InferenceType::nodeToNeighbours, InferenceType::ordered, InferenceType::randomOrder } |
Inference type to be used by the algorithm. More... | |
using | msg = std::vector< Potential< GUM_SCALAR > *> |
using | cArcP = const Arc * |
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 | |
NodeProperty< bool > | _update_p |
Used to keep track of which node needs to update it's information coming from it's parents. More... | |
NodeProperty< bool > | _update_l |
Used to keep track of which node needs to update it's information coming from it's children. More... | |
NodeSet | active_nodes_set |
The current node-set to iterate through at this current step. More... | |
NodeSet | next_active_nodes_set |
The next node-set, i.e. More... | |
NodeProperty< NodeSet *> | _msg_l_sent |
Used to keep track of one's messages sent to it's parents. More... | |
ArcProperty< GUM_SCALAR > | _ArcsL_min |
"Lower" information \( \Lambda \) coming from one's children. More... | |
ArcProperty< GUM_SCALAR > | _ArcsP_min |
"Lower" information \( \pi \) coming from one's parent. More... | |
NodeProperty< GUM_SCALAR > | _NodesL_min |
"Lower" node information \( \Lambda \) obtained by combinaison of children messages. More... | |
NodeProperty< GUM_SCALAR > | _NodesP_min |
"Lower" node information \( \pi \) obtained by combinaison of parent's messages. More... | |
ArcProperty< GUM_SCALAR > | _ArcsL_max |
"Upper" information \( \Lambda \) coming from one's children. More... | |
ArcProperty< GUM_SCALAR > | _ArcsP_max |
"Upper" information \( \pi \) coming from one's parent. More... | |
NodeProperty< GUM_SCALAR > | _NodesL_max |
"Upper" node information \( \Lambda \) obtained by combinaison of children messages. More... | |
NodeProperty< GUM_SCALAR > | _NodesP_max |
"Upper" node information \( \pi \) obtained by combinaison of parent's messages. More... | |
bool | _InferenceUpToDate |
TRUE if inference has already been performed, FALSE otherwise. More... | |
const CredalNet< GUM_SCALAR > * | _credalNet |
A pointer to the Credal Net used. More... | |
margi | _oldMarginalMin |
Old lower marginals used to compute epsilon. More... | |
margi | _oldMarginalMax |
Old upper marginals used to compute epsilon. More... | |
margi | _marginalMin |
Lower marginals. More... | |
margi | _marginalMax |
Upper marginals. More... | |
credalSet | _marginalSets |
Credal sets vertices, if enabled. More... | |
expe | _expectationMin |
Lower expectations, if some variables modalities were inserted. More... | |
expe | _expectationMax |
Upper expectations, if some variables modalities were inserted. More... | |
dynExpe | _dynamicExpMin |
Lower dynamic expectations. More... | |
dynExpe | _dynamicExpMax |
Upper dynamic expectations. More... | |
dynExpe | _modal |
Variables modalities used to compute expectations. More... | |
margi | _evidence |
Holds observed variables states. More... | |
query | _query |
Holds the query nodes states. More... | |
cluster | _t0 |
Clusters of nodes used with dynamic networks. More... | |
cluster | _t1 |
Clusters of nodes used with dynamic networks. More... | |
bool | _storeVertices |
True if credal sets vertices are stored, False otherwise. More... | |
bool | _repetitiveInd |
True if using repetitive independence ( dynamic network only ), False otherwise. More... | |
bool | _storeBNOpt |
Iterations limit stopping rule used by some algorithms such as CNMonteCarloSampling. More... | |
VarMod2BNsMap< GUM_SCALAR > | _dbnOpt |
Object used to efficiently store optimal bayes net during inference, for some algorithms. More... | |
int | _timeSteps |
The number of time steps of this network (only usefull for dynamic networks). 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 | |
Protected initialization methods | |
void | _initialize () |
Topological forward propagation to initialize old marginals & messages. More... | |
Protected algorithm methods | |
void | _makeInferenceNodeToNeighbours () |
Starts the inference with this inference type. More... | |
void | _makeInferenceByOrderedArcs () |
Starts the inference with this inference type. More... | |
void | _makeInferenceByRandomOrder () |
Starts the inference with this inference type. More... | |
void | _updateMarginals () |
Compute marginals from up-to-date messages. More... | |
void | _msgL (const NodeId X, const NodeId demanding_parent) |
Sends a message to one's parent, i.e. More... | |
void | _compute_ext (GUM_SCALAR &msg_l_min, GUM_SCALAR &msg_l_max, std::vector< GUM_SCALAR > &lx, GUM_SCALAR &num_min, GUM_SCALAR &num_max, GUM_SCALAR &den_min, GUM_SCALAR &den_max) |
Used by _msgL. More... | |
void | _compute_ext (std::vector< std::vector< GUM_SCALAR > > &combi_msg_p, const NodeId &id, GUM_SCALAR &msg_l_min, GUM_SCALAR &msg_l_max, std::vector< GUM_SCALAR > &lx, const Idx &pos) |
Used by _msgL. More... | |
void | _enum_combi (std::vector< std::vector< std::vector< GUM_SCALAR > > > &msgs_p, const NodeId &id, GUM_SCALAR &msg_l_min, GUM_SCALAR &msg_l_max, std::vector< GUM_SCALAR > &lx, const Idx &pos) |
Used by _msgL. More... | |
void | _msgP (const NodeId X, const NodeId demanding_child) |
Sends a message to one's child, i.e. More... | |
void | _enum_combi (std::vector< std::vector< std::vector< GUM_SCALAR > > > &msgs_p, const NodeId &id, GUM_SCALAR &msg_p_min, GUM_SCALAR &msg_p_max) |
Used by _msgP. More... | |
void | _compute_ext (std::vector< std::vector< GUM_SCALAR > > &combi_msg_p, const NodeId &id, GUM_SCALAR &msg_p_min, GUM_SCALAR &msg_p_max) |
Used by _msgP. More... | |
void | _refreshLMsPIs (bool refreshIndic=false) |
Get the last messages from one's parents and children. More... | |
GUM_SCALAR | _calculateEpsilon () |
Compute epsilon. More... | |
Post-inference protected methods | |
void | _computeExpectations () |
Since the network is binary, expectations can be computed from the final marginals which give us the credal set vertices. More... | |
void | _updateIndicatrices () |
Only update indicatrices variables at the end of computations ( calls _msgP ). More... | |
Protected initialization methods | |
void | _repetitiveInit () |
Initialize _t0 and _t1 clusters. More... | |
void | _initExpectations () |
Initialize lower and upper expectations before inference, with the lower expectation being initialized on the highest modality and the upper expectation being initialized on the lowest modality. More... | |
void | _initMarginals () |
Initialize lower and upper old marginals and marginals before inference, with the lower marginal being 1 and the upper 0. More... | |
void | _initMarginalSets () |
Initialize credal set vertices with empty sets. More... | |
Protected algorithms methods | |
const GUM_SCALAR | _computeEpsilon () |
Compute approximation scheme epsilon using the old marginals and the new ones. More... | |
void | _updateExpectations (const NodeId &id, const std::vector< GUM_SCALAR > &vertex) |
Given a node id and one of it's possible vertex obtained during inference, update this node lower and upper expectations. More... | |
void | _updateCredalSets (const NodeId &id, const std::vector< GUM_SCALAR > &vertex, const bool &elimRedund=false) |
Given a node id and one of it's possible vertex, update it's credal set. More... | |
Proptected post-inference methods | |
void | _dynamicExpectations () |
Rearrange lower and upper expectations to suit dynamic networks. More... | |
<agrum/CN/CNLoopyPropagation.h>
Class implementing loopy-propagation with binary networks - L2U algorithm.
GUM_SCALAR | A floating type ( float, double, long double ... ). |
Definition at line 58 of file CNLoopyPropagation.h.
|
private |
To easily access InferenceEngine< GUM_SCALAR > methods.
Definition at line 368 of file CNLoopyPropagation.h.
using gum::credal::CNLoopyPropagation< GUM_SCALAR >::cArcP = const Arc* |
Definition at line 61 of file CNLoopyPropagation.h.
using gum::credal::CNLoopyPropagation< GUM_SCALAR >::msg = std::vector< Potential< GUM_SCALAR >* > |
Definition at line 60 of file CNLoopyPropagation.h.
|
stronginherited |
The different state of an approximation scheme.
Enumerator | |
---|---|
Undefined | |
Continue | |
Epsilon | |
Rate | |
Limit | |
TimeLimit | |
Stopped |
Definition at line 65 of file IApproximationSchemeConfiguration.h.
|
strong |
Inference type to be used by the algorithm.
Definition at line 66 of file CNLoopyPropagation.h.
|
explicit |
Constructor.
cnet | The CredalNet to be used with this algorithm. |
Definition at line 1508 of file CNLoopyPropagation_tpl.h.
References gum::credal::CNLoopyPropagation< GUM_SCALAR >::__bnet, gum::credal::CNLoopyPropagation< GUM_SCALAR >::__cn, gum::credal::CNLoopyPropagation< GUM_SCALAR >::__inferenceType, gum::credal::CNLoopyPropagation< GUM_SCALAR >::_InferenceUpToDate, gum::credal::CredalNet< GUM_SCALAR >::current_bn(), GUM_ERROR, gum::credal::CredalNet< GUM_SCALAR >::hasComputedCPTMinMax(), gum::credal::CredalNet< GUM_SCALAR >::isSeparatelySpecified(), and gum::credal::CNLoopyPropagation< GUM_SCALAR >::nodeToNeighbours.
|
virtual |
Destructor.
Definition at line 1543 of file CNLoopyPropagation_tpl.h.
References gum::credal::CNLoopyPropagation< GUM_SCALAR >::__bnet, gum::credal::CNLoopyPropagation< GUM_SCALAR >::_InferenceUpToDate, and gum::credal::CNLoopyPropagation< GUM_SCALAR >::_msg_l_sent.
|
protected |
Compute epsilon.
Definition at line 1457 of file CNLoopyPropagation_tpl.h.
|
protected |
Used by _msgL.
pour les fonctions suivantes, les GUM_SCALAR min/max doivent etre initialises (min a 1 et max a 0) pour comparer avec les resultats intermediaires
Compute the final message for the given parent's message and likelihood (children's messages), numerators & denominators.
msg_l_min | The reference to the current lower value of the message to be sent. |
msg_l_max | The reference to the current upper value of the message to be sent. |
lx | The lower and upper likelihood. |
num_min | The reference to the previously computed lower numerator. |
num_max | The reference to the previously computed upper numerator. |
den_min | The reference to the previously computed lower denominator. |
den_max | The reference to the previously computed upper denominator. |
une fois les cpts marginalises sur X et Ui, on calcul le min/max,
Definition at line 181 of file CNLoopyPropagation_tpl.h.
References _INF.
|
protected |
Used by _msgL.
extremes pour une combinaison des parents, message vers parent
Compute the numerators & denominators for the given parent's message and likelihood (children's messages). Marginalisation.
combi_msg_p | The parent's choosen message. |
id | The constant id of the node sending the message. |
msg_l_min | The reference to the current lower value of the message to be sent. |
msg_l_max | The reference to the current upper value of the message to be sent. |
lx | The lower and upper likelihood. |
pos | The position of the parent node to receive the message in the CPT of the one sending the message ( first parent, second ... ). |
Definition at line 271 of file CNLoopyPropagation_tpl.h.
|
protected |
Used by _msgP.
extremes pour une combinaison des parents, message vers enfant marginalisation cpts
Marginalisation.
combi_msg_p | The parent's choosen message. |
id | The constant id of the node sending the message. |
msg_p_min | The reference to the current lower value of the message to be sent. |
msg_p_max | The reference to the current upper value of the message to be sent. |
Definition at line 337 of file CNLoopyPropagation_tpl.h.
|
inlineprotectedinherited |
Compute approximation scheme epsilon using the old marginals and the new ones.
Highest delta on either lower or upper marginal is epsilon.
Also updates oldMarginals to current marginals.
Definition at line 1016 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMax, gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMin, gum::credal::InferenceEngine< GUM_SCALAR >::_oldMarginalMax, gum::credal::InferenceEngine< GUM_SCALAR >::_oldMarginalMin, and gum::HashTable< Key, Val, Alloc >::size().
|
protected |
Since the network is binary, expectations can be computed from the final marginals which give us the credal set vertices.
Definition at line 1482 of file CNLoopyPropagation_tpl.h.
|
protectedinherited |
Rearrange lower and upper expectations to suit dynamic networks.
Definition at line 721 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpMax, gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpMin, gum::credal::InferenceEngine< GUM_SCALAR >::_expectationMax, gum::credal::InferenceEngine< GUM_SCALAR >::_expectationMin, gum::credal::InferenceEngine< GUM_SCALAR >::_modal, and gum::HashTable< Key, Val, Alloc >::empty().
Referenced by gum::credal::InferenceEngine< GUM_SCALAR >::dynamicExpectations(), and gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::makeInference().
|
protected |
Used by _msgL.
comme precedemment mais pour message parent, vraisemblance prise en compte
Enumerate parent's messages.
msgs_p | All the messages from the parents which will be enumerated. |
id | The constant id of the node sending the message. |
msg_l_min | The reference to the current lower value of the message to be sent. |
msg_l_max | The reference to the current upper value of the message to be sent. |
lx | The lower and upper likelihood. |
pos | The position of the parent node to receive the message in the CPT of the one sending the message ( first parent, second ... ). |
Definition at line 464 of file CNLoopyPropagation_tpl.h.
|
protected |
Used by _msgP.
enumere combinaisons messages parents, pour message vers enfant
Enumerate parent's messages.
msgs_p | All the messages from the parents which will be enumerated. |
id | The constant id of the node sending the message. |
msg_p_min | The reference to the current lower value of the message to be sent. |
msg_p_max | The reference to the current upper value of the message to be sent. |
Definition at line 388 of file CNLoopyPropagation_tpl.h.
|
protectedinherited |
Initialize lower and upper expectations before inference, with the lower expectation being initialized on the highest modality and the upper expectation being initialized on the lowest modality.
Definition at line 695 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_expectationMax, gum::credal::InferenceEngine< GUM_SCALAR >::_expectationMin, gum::credal::InferenceEngine< GUM_SCALAR >::_modal, gum::HashTable< Key, Val, Alloc >::clear(), and gum::HashTable< Key, Val, Alloc >::insert().
Referenced by gum::credal::InferenceEngine< GUM_SCALAR >::eraseAllEvidence(), gum::credal::InferenceEngine< GUM_SCALAR >::insertModals(), and gum::credal::InferenceEngine< GUM_SCALAR >::insertModalsFile().
|
protected |
Topological forward propagation to initialize old marginals & messages.
Definition at line 605 of file CNLoopyPropagation_tpl.h.
References _INF, gum::ArcGraphPart::children(), GUM_ERROR, gum::Set< Key, Alloc >::insert(), gum::ArcGraphPart::parents(), and gum::Set< Key, Alloc >::size().
|
protectedinherited |
Initialize lower and upper old marginals and marginals before inference, with the lower marginal being 1 and the upper 0.
Definition at line 663 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMax, gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMin, gum::credal::InferenceEngine< GUM_SCALAR >::_oldMarginalMax, gum::credal::InferenceEngine< GUM_SCALAR >::_oldMarginalMin, gum::HashTable< Key, Val, Alloc >::clear(), and gum::HashTable< Key, Val, Alloc >::insert().
Referenced by gum::credal::InferenceEngine< GUM_SCALAR >::eraseAllEvidence(), and gum::credal::InferenceEngine< GUM_SCALAR >::InferenceEngine().
|
protectedinherited |
Initialize credal set vertices with empty sets.
Definition at line 680 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_marginalSets, gum::credal::InferenceEngine< GUM_SCALAR >::_storeVertices, gum::HashTable< Key, Val, Alloc >::clear(), and gum::HashTable< Key, Val, Alloc >::insert().
Referenced by gum::credal::InferenceEngine< GUM_SCALAR >::eraseAllEvidence(), and gum::credal::InferenceEngine< GUM_SCALAR >::storeVertices().
|
protected |
Starts the inference with this inference type.
Definition at line 824 of file CNLoopyPropagation_tpl.h.
References gum::credal::CredalNet< GUM_SCALAR >::currentNodeType().
|
protected |
Starts the inference with this inference type.
Definition at line 778 of file CNLoopyPropagation_tpl.h.
References gum::credal::CredalNet< GUM_SCALAR >::currentNodeType(), and gum::credal::lp::swap().
|
protected |
Starts the inference with this inference type.
Definition at line 733 of file CNLoopyPropagation_tpl.h.
References gum::ArcGraphPart::children(), and gum::ArcGraphPart::parents().
|
protected |
Sends a message to one's parent, i.e.
X is sending a message to a demanding_parent.
X | The constant node id of the node sending the message. |
demanding_parent | The constant node id of the node receiving the message. |
Definition at line 859 of file CNLoopyPropagation_tpl.h.
References gum::Set< Key, Alloc >::empty(), gum::Set< Key, Alloc >::insert(), and gum::Set< Key, Alloc >::size().
|
protected |
Sends a message to one's child, i.e.
X is sending a message to a demanding_child.
X | The constant node id of the node sending the message. |
demanding_child | The constant node id of the node receiving the message. |
Definition at line 1045 of file CNLoopyPropagation_tpl.h.
References _INF, gum::Set< Key, Alloc >::erase(), and gum::Set< Key, Alloc >::size().
|
protected |
Get the last messages from one's parents and children.
Definition at line 1254 of file CNLoopyPropagation_tpl.h.
References _INF, gum::Set< Key, Alloc >::empty(), and gum::Set< Key, Alloc >::erase().
|
protectedinherited |
Initialize _t0 and _t1 clusters.
Definition at line 784 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_t0, gum::credal::InferenceEngine< GUM_SCALAR >::_t1, gum::credal::InferenceEngine< GUM_SCALAR >::_timeSteps, gum::HashTable< Key, Val, Alloc >::clear(), GUM_ERROR, and gum::HashTable< Key, Val, Alloc >::insert().
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::makeInference(), and gum::credal::InferenceEngine< GUM_SCALAR >::setRepetitiveInd().
|
inlineprotectedinherited |
Given a node id and one of it's possible vertex, update it's credal set.
To maximise efficiency, don't pass a vertex we know is inside the polytope (i.e. not at an extreme value for any modality)
id | The id of the node to be updated |
vertex | A (potential) vertex of the node credal set |
elimRedund | remove redundant vertex (inside a facet) |
Definition at line 928 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMax, gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMin, gum::credal::InferenceEngine< GUM_SCALAR >::_marginalSets, gum::HashTable< Key, Val, Alloc >::cbegin(), gum::HashTable< Key, Val, Alloc >::cend(), gum::credal::LRSWrapper< GUM_SCALAR >::elimRedundVrep(), gum::credal::LRSWrapper< GUM_SCALAR >::fillV(), gum::credal::LRSWrapper< GUM_SCALAR >::getOutput(), and gum::credal::LRSWrapper< GUM_SCALAR >::setUpV().
Referenced by gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_verticesFusion().
|
inlineprotectedinherited |
Given a node id and one of it's possible vertex obtained during inference, update this node lower and upper expectations.
id | The id of the node to be updated |
vertex | A (potential) vertex of the node credal set |
Definition at line 907 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_expectationMax, gum::credal::InferenceEngine< GUM_SCALAR >::_expectationMin, and gum::credal::InferenceEngine< GUM_SCALAR >::_modal.
|
protected |
Only update indicatrices variables at the end of computations ( calls _msgP ).
Definition at line 1465 of file CNLoopyPropagation_tpl.h.
|
protected |
Compute marginals from up-to-date messages.
Definition at line 1361 of file CNLoopyPropagation_tpl.h.
References _INF.
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 227 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_current_epsilon, gum::ApproximationScheme::_current_rate, gum::ApproximationScheme::_current_state, gum::ApproximationScheme::_current_step, gum::ApproximationScheme::_enabled_eps, gum::ApproximationScheme::_enabled_max_iter, gum::ApproximationScheme::_enabled_max_time, gum::ApproximationScheme::_enabled_min_rate_eps, gum::ApproximationScheme::_eps, gum::ApproximationScheme::_history, gum::ApproximationScheme::_last_epsilon, gum::ApproximationScheme::_max_iter, gum::ApproximationScheme::_max_time, gum::ApproximationScheme::_min_rate_eps, gum::ApproximationScheme::_stopScheme(), gum::ApproximationScheme::_timer, gum::IApproximationSchemeConfiguration::Continue, gum::IApproximationSchemeConfiguration::Epsilon, GUM_EMIT3, GUM_ERROR, gum::IApproximationSchemeConfiguration::Limit, gum::IApproximationSchemeConfiguration::messageApproximationScheme(), gum::IApproximationSchemeConfiguration::onProgress, gum::IApproximationSchemeConfiguration::Rate, gum::ApproximationScheme::startOfPeriod(), gum::ApproximationScheme::stateApproximationScheme(), gum::Timer::step(), gum::IApproximationSchemeConfiguration::TimeLimit, and gum::ApproximationScheme::verbosity().
Referenced by gum::GibbsBNdistance< GUM_SCALAR >::_computeKL(), gum::SamplingInference< GUM_SCALAR >::_loopApproxInference(), gum::learning::DAG2BNLearner< ALLOC >::createBN(), gum::learning::GreedyHillClimbing::learnStructure(), gum::learning::LocalSearchWithTabuList::learnStructure(), and gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::makeInference().
|
inherited |
Get this creadal network.
Definition at line 59 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet.
Referenced by gum::credal::InferenceEngine< GUM_SCALAR >::InferenceEngine().
|
virtualinherited |
Returns the current running time in second.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 128 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_timer, and gum::Timer::step().
Referenced by gum::learning::genericBNLearner::currentTime().
|
virtualinherited |
Disable stopping criterion on epsilon.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 54 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_eps.
Referenced by gum::learning::genericBNLearner::disableEpsilon().
|
virtualinherited |
Disable stopping criterion on max iterations.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 105 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_max_iter.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcInitApproximationScheme(), gum::learning::genericBNLearner::disableMaxIter(), and gum::learning::GreedyHillClimbing::GreedyHillClimbing().
|
virtualinherited |
Disable stopping criterion on timeout.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 131 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_max_time.
Referenced by gum::learning::genericBNLearner::disableMaxTime(), and gum::learning::GreedyHillClimbing::GreedyHillClimbing().
|
virtualinherited |
Disable stopping criterion on epsilon rate.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 79 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_min_rate_eps.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcInitApproximationScheme(), gum::GibbsBNdistance< GUM_SCALAR >::_computeKL(), gum::learning::genericBNLearner::disableMinEpsilonRate(), and gum::learning::GreedyHillClimbing::GreedyHillClimbing().
|
inherited |
Compute dynamic expectations.
Definition at line 716 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpectations().
|
inherited |
Get the upper dynamic expectation of a given variable prefix (without the time step included, i.e.
call with "temp" to get "temp_0", ..., "temp_T").
varName | The variable name prefix which upper expectation we want. |
Definition at line 504 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpMax, and GUM_ERROR.
|
inherited |
Get the lower dynamic expectation of a given variable prefix (without the time step included, i.e.
call with "temp" to get "temp_0", ..., "temp_T").
varName | The variable name prefix which lower expectation we want. |
Definition at line 486 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpMin, and GUM_ERROR.
|
virtualinherited |
Enable stopping criterion on epsilon.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 57 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_eps.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcInitApproximationScheme(), and gum::learning::genericBNLearner::enableEpsilon().
|
virtualinherited |
Enable stopping criterion on max iterations.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 108 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_max_iter.
Referenced by gum::learning::genericBNLearner::enableMaxIter().
|
virtualinherited |
Enable stopping criterion on timeout.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 134 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_max_time.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::CNMonteCarloSampling(), and gum::learning::genericBNLearner::enableMaxTime().
|
virtualinherited |
Enable stopping criterion on epsilon rate.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 84 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_min_rate_eps.
Referenced by gum::GibbsBNdistance< GUM_SCALAR >::_computeKL(), and gum::learning::genericBNLearner::enableMinEpsilonRate().
|
virtualinherited |
Returns the value of epsilon.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 51 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_eps.
Referenced by gum::ImportanceSampling< GUM_SCALAR >::_onContextualize(), and gum::learning::genericBNLearner::epsilon().
|
virtual |
Erase all inference related data to perform another one.
You need to insert evidence again if needed but modalities are kept. You can insert new ones by using the appropriate method which will delete the old ones.
Reimplemented from gum::credal::InferenceEngine< GUM_SCALAR >.
Definition at line 576 of file CNLoopyPropagation_tpl.h.
|
inherited |
Get the upper expectation of a given node id.
id | The node id which upper expectation we want. |
Definition at line 479 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_expectationMax.
|
inherited |
Get the upper expectation of a given variable name.
varName | The variable name which upper expectation we want. |
Definition at line 462 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, and gum::credal::InferenceEngine< GUM_SCALAR >::_expectationMax.
|
inherited |
Get the lower expectation of a given node id.
id | The node id which lower expectation we want. |
Definition at line 471 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_expectationMin.
|
inherited |
Get the lower expectation of a given variable name.
varName | The variable name which lower expectation we want. |
Definition at line 454 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, and gum::credal::InferenceEngine< GUM_SCALAR >::_expectationMin.
|
inlineinherited |
Get approximation scheme state.
Definition at line 515 of file inferenceEngine.h.
References gum::IApproximationSchemeConfiguration::messageApproximationScheme().
|
inherited |
Get the _t0 cluster.
Definition at line 1005 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_t0.
|
inherited |
Get the _t1 cluster.
Definition at line 1011 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_t1.
|
inherited |
Get optimum IBayesNet.
Definition at line 141 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_dbnOpt.
|
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 173 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_history, GUM_ERROR, gum::ApproximationScheme::stateApproximationScheme(), gum::IApproximationSchemeConfiguration::Undefined, and gum::ApproximationScheme::verbosity().
Referenced by gum::learning::genericBNLearner::history().
void gum::credal::CNLoopyPropagation< GUM_SCALAR >::inferenceType | ( | InferenceType | inft | ) |
Set the inference type.
inft | The choosen InferenceType . |
Definition at line 1560 of file CNLoopyPropagation_tpl.h.
References gum::credal::CNLoopyPropagation< GUM_SCALAR >::__inferenceType.
CNLoopyPropagation< GUM_SCALAR >::InferenceType gum::credal::CNLoopyPropagation< GUM_SCALAR >::inferenceType | ( | ) |
Get the inference type.
Definition at line 1566 of file CNLoopyPropagation_tpl.h.
References gum::credal::CNLoopyPropagation< GUM_SCALAR >::__inferenceType.
|
inherited |
Initialise the scheme.
Definition at line 187 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_current_epsilon, gum::ApproximationScheme::_current_rate, gum::ApproximationScheme::_current_state, gum::ApproximationScheme::_current_step, gum::ApproximationScheme::_history, gum::ApproximationScheme::_timer, gum::IApproximationSchemeConfiguration::Continue, and gum::Timer::reset().
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcInitApproximationScheme(), gum::GibbsBNdistance< GUM_SCALAR >::_computeKL(), gum::SamplingInference< GUM_SCALAR >::_loopApproxInference(), gum::SamplingInference< GUM_SCALAR >::_onStateChanged(), gum::learning::DAG2BNLearner< ALLOC >::createBN(), gum::learning::GreedyHillClimbing::learnStructure(), and gum::learning::LocalSearchWithTabuList::learnStructure().
|
inherited |
Insert evidence from map.
eviMap | The map variable name - likelihood. |
Definition at line 229 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_evidence, gum::HashTable< Key, Val, Alloc >::clear(), gum::HashTable< Key, Val, Alloc >::empty(), GUM_SHOWERROR, and gum::HashTable< Key, Val, Alloc >::insert().
|
inherited |
Insert evidence from Property.
evidence | The on nodes Property containing likelihoods. |
Definition at line 251 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_evidence, gum::HashTable< Key, Val, Alloc >::clear(), gum::HashTable< Key, Val, Alloc >::empty(), GUM_SHOWERROR, and gum::HashTable< Key, Val, Alloc >::insert().
|
inlinevirtual |
Insert evidence from file.
path | The path to the evidence file. |
Reimplemented from gum::credal::InferenceEngine< GUM_SCALAR >.
Definition at line 382 of file CNLoopyPropagation.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::insertEvidenceFile().
|
inherited |
Insert variables modalities from map to compute expectations.
modals | The map variable name - modalities. |
Definition at line 193 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_initExpectations(), gum::credal::InferenceEngine< GUM_SCALAR >::_modal, and GUM_SHOWERROR.
|
inherited |
Insert variables modalities from file to compute expectations.
path | The path to the modalities file. |
Definition at line 146 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_initExpectations(), gum::credal::InferenceEngine< GUM_SCALAR >::_modal, and GUM_ERROR.
|
inherited |
Insert query variables and states from Property.
query | The on nodes Property containing queried variables states. |
Definition at line 331 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_query, gum::HashTable< Key, Val, Alloc >::clear(), gum::HashTable< Key, Val, Alloc >::empty(), GUM_SHOWERROR, and gum::HashTable< Key, Val, Alloc >::insert().
|
inherited |
Insert query variables states from file.
path | The path to the query file. |
Definition at line 348 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_query, gum::HashTable< Key, Val, Alloc >::clear(), gum::HashTable< Key, Val, Alloc >::empty(), GUM_ERROR, GUM_SHOWERROR, and gum::HashTable< Key, Val, Alloc >::insert().
|
virtualinherited |
Returns true if stopping criterion on epsilon is enabled, false otherwise.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 61 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_eps.
Referenced by gum::learning::genericBNLearner::isEnabledEpsilon().
|
virtualinherited |
Returns true if stopping criterion on max iterations is enabled, false otherwise.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 112 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_max_iter.
Referenced by gum::learning::genericBNLearner::isEnabledMaxIter().
|
virtualinherited |
Returns true if stopping criterion on timeout is enabled, false otherwise.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 138 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_max_time.
Referenced by gum::learning::genericBNLearner::isEnabledMaxTime().
|
virtualinherited |
Returns true if stopping criterion on epsilon rate is enabled, false otherwise.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 90 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_min_rate_eps.
Referenced by gum::GibbsBNdistance< GUM_SCALAR >::_computeKL(), and gum::learning::genericBNLearner::isEnabledMinEpsilonRate().
|
virtual |
Starts the inference.
Implements gum::credal::InferenceEngine< GUM_SCALAR >.
Definition at line 550 of file CNLoopyPropagation_tpl.h.
|
inherited |
Get the upper marginals of a given node id.
id | The node id which upper marginals we want. |
Definition at line 447 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMax.
|
inherited |
Get the upper marginals of a given variable name.
varName | The variable name which upper marginals we want. |
Definition at line 430 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, and gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMax.
|
inherited |
Get the lower marginals of a given node id.
id | The node id which lower marginals we want. |
Definition at line 439 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMin.
|
inherited |
Get the lower marginals of a given variable name.
varName | The variable name which lower marginals we want. |
Definition at line 422 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, and gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMin.
|
virtualinherited |
Returns the criterion on number of iterations.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 102 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_max_iter.
Referenced by gum::learning::genericBNLearner::maxIter().
|
virtualinherited |
Returns the timeout (in seconds).
Implements gum::IApproximationSchemeConfiguration.
Definition at line 125 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_max_time.
Referenced by gum::learning::genericBNLearner::maxTime().
|
inherited |
Returns the approximation scheme message.
Definition at line 40 of file IApproximationSchemeConfiguration_inl.h.
References gum::IApproximationSchemeConfiguration::Continue, gum::IApproximationSchemeConfiguration::Epsilon, gum::IApproximationSchemeConfiguration::epsilon(), gum::IApproximationSchemeConfiguration::Limit, gum::IApproximationSchemeConfiguration::maxIter(), gum::IApproximationSchemeConfiguration::maxTime(), gum::IApproximationSchemeConfiguration::minEpsilonRate(), gum::IApproximationSchemeConfiguration::Rate, gum::IApproximationSchemeConfiguration::stateApproximationScheme(), gum::IApproximationSchemeConfiguration::Stopped, gum::IApproximationSchemeConfiguration::TimeLimit, and gum::IApproximationSchemeConfiguration::Undefined.
Referenced by gum::ApproximationScheme::_stopScheme(), gum::ApproximationScheme::continueApproximationScheme(), and gum::credal::InferenceEngine< GUM_SCALAR >::getApproximationSchemeMsg().
|
virtualinherited |
Returns the value of the minimal epsilon rate.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 74 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_min_rate_eps.
Referenced by gum::learning::genericBNLearner::minEpsilonRate().
|
virtualinherited |
Returns the number of iterations.
OperationNotAllowed | Raised if the scheme did not perform. |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 163 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_current_step, GUM_ERROR, gum::ApproximationScheme::stateApproximationScheme(), and gum::IApproximationSchemeConfiguration::Undefined.
Referenced by gum::GibbsBNdistance< GUM_SCALAR >::_computeKL(), and gum::learning::genericBNLearner::nbrIterations().
|
virtualinherited |
Returns the period size.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 149 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_period_size.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::makeInference(), and gum::learning::genericBNLearner::periodSize().
|
inherited |
Returns the remaining burn in.
Definition at line 210 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_burn_in, and gum::ApproximationScheme::_current_step.
|
inherited |
Get the current independence status.
True
if repetitive, False
otherwise. Definition at line 120 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_repetitiveInd.
|
inherited |
Saves expectations to file.
path | The path to the file to be used. |
Definition at line 554 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpMax, gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpMin, and GUM_ERROR.
void gum::credal::CNLoopyPropagation< GUM_SCALAR >::saveInference | ( | const std::string & | path | ) |
This one is easier to read but harder for scripts to parse.
path | The path to the file to save marginals. |
Definition at line 29 of file CNLoopyPropagation_tpl.h.
References _INF, and GUM_ERROR.
|
inherited |
Saves marginals to file.
path | The path to the file to be used. |
Definition at line 528 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMax, gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMin, and GUM_ERROR.
|
inherited |
Saves vertices to file.
path | The path to the file to be used. |
Definition at line 628 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_marginalSets, and GUM_ERROR.
|
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 43 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_eps, gum::ApproximationScheme::_eps, and GUM_ERROR.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcInitApproximationScheme(), gum::GibbsBNdistance< GUM_SCALAR >::GibbsBNdistance(), gum::GibbsSampling< GUM_SCALAR >::GibbsSampling(), gum::learning::GreedyHillClimbing::GreedyHillClimbing(), gum::SamplingInference< GUM_SCALAR >::SamplingInference(), and gum::learning::genericBNLearner::setEpsilon().
|
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 95 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_max_iter, gum::ApproximationScheme::_max_iter, and GUM_ERROR.
Referenced by gum::GibbsBNdistance< GUM_SCALAR >::GibbsBNdistance(), gum::SamplingInference< GUM_SCALAR >::SamplingInference(), and gum::learning::genericBNLearner::setMaxIter().
|
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 118 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_max_time, gum::ApproximationScheme::_max_time, and GUM_ERROR.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::CNMonteCarloSampling(), gum::GibbsBNdistance< GUM_SCALAR >::GibbsBNdistance(), gum::SamplingInference< GUM_SCALAR >::SamplingInference(), and gum::learning::genericBNLearner::setMaxTime().
|
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 66 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_enabled_min_rate_eps, gum::ApproximationScheme::_min_rate_eps, and GUM_ERROR.
Referenced by gum::GibbsBNdistance< GUM_SCALAR >::GibbsBNdistance(), gum::GibbsSampling< GUM_SCALAR >::GibbsSampling(), gum::SamplingInference< GUM_SCALAR >::SamplingInference(), and gum::learning::genericBNLearner::setMinEpsilonRate().
|
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 143 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_period_size, and GUM_ERROR.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::CNMonteCarloSampling(), gum::GibbsBNdistance< GUM_SCALAR >::GibbsBNdistance(), gum::SamplingInference< GUM_SCALAR >::SamplingInference(), and gum::learning::genericBNLearner::setPeriodSize().
|
inherited |
repetitive | True if repetitive independence is to be used, false otherwise. Only usefull with dynamic networks. |
Definition at line 111 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_repetitiveInd, and gum::credal::InferenceEngine< GUM_SCALAR >::_repetitiveInit().
|
virtualinherited |
Set the verbosity on (true) or off (false).
v | If true, then verbosity is turned on. |
Implements gum::IApproximationSchemeConfiguration.
Definition at line 152 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_verbosity.
Referenced by gum::GibbsBNdistance< GUM_SCALAR >::GibbsBNdistance(), gum::SamplingInference< GUM_SCALAR >::SamplingInference(), and gum::learning::genericBNLearner::setVerbosity().
|
inherited |
Returns true if we are at the beginning of a period (compute error is mandatory).
Definition at line 197 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_burn_in, gum::ApproximationScheme::_current_step, and gum::ApproximationScheme::_period_size.
Referenced by gum::ApproximationScheme::continueApproximationScheme().
|
virtualinherited |
Returns the approximation scheme state.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 158 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_current_state.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::history(), gum::ApproximationScheme::nbrIterations(), and gum::learning::genericBNLearner::stateApproximationScheme().
|
inherited |
Stop the approximation scheme.
Definition at line 219 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_current_state, gum::ApproximationScheme::_stopScheme(), gum::IApproximationSchemeConfiguration::Continue, and gum::IApproximationSchemeConfiguration::Stopped.
Referenced by gum::learning::DAG2BNLearner< ALLOC >::createBN(), gum::learning::GreedyHillClimbing::learnStructure(), and gum::learning::LocalSearchWithTabuList::learnStructure().
|
inherited |
value | True if optimal bayesian networks are to be stored for each variable and each modality. |
Definition at line 99 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_storeBNOpt.
|
inherited |
True
if optimal bayes net are stored for each variable and each modality, False
otherwise. Definition at line 135 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_storeBNOpt.
|
inherited |
value | True if vertices are to be stored, false otherwise. |
Definition at line 104 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_initMarginalSets(), and gum::credal::InferenceEngine< GUM_SCALAR >::_storeVertices.
|
inherited |
Get the number of iterations without changes used to stop some algorithms.
True
if vertice are stored, False
otherwise. Definition at line 130 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_storeVertices.
|
inherited |
Print all nodes marginals to standart output.
Definition at line 599 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_credalNet, gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMax, gum::credal::InferenceEngine< GUM_SCALAR >::_marginalMin, gum::credal::InferenceEngine< GUM_SCALAR >::_query, gum::HashTable< Key, Val, Alloc >::empty(), and gum::HashTable< Key, Val, Alloc >::exists().
|
inherited |
Update the scheme w.r.t the new error and increment steps.
incr | The new increment steps. |
Definition at line 206 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_current_step.
Referenced by gum::GibbsBNdistance< GUM_SCALAR >::_computeKL(), gum::SamplingInference< GUM_SCALAR >::_loopApproxInference(), gum::learning::DAG2BNLearner< ALLOC >::createBN(), gum::learning::GreedyHillClimbing::learnStructure(), gum::learning::LocalSearchWithTabuList::learnStructure(), and gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::makeInference().
|
virtualinherited |
Returns true if verbosity is enabled.
Implements gum::IApproximationSchemeConfiguration.
Definition at line 154 of file approximationScheme_inl.h.
References gum::ApproximationScheme::_verbosity.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::history(), and gum::learning::genericBNLearner::verbosity().
|
inherited |
Get the vertice of a given node id.
id | The node id which vertice we want. |
Definition at line 523 of file inferenceEngine_tpl.h.
References gum::credal::InferenceEngine< GUM_SCALAR >::_marginalSets.
|
private |
A pointer to it's IBayesNet used as a DAG.
Definition at line 377 of file CNLoopyPropagation.h.
Referenced by gum::credal::CNLoopyPropagation< GUM_SCALAR >::CNLoopyPropagation(), and gum::credal::CNLoopyPropagation< GUM_SCALAR >::~CNLoopyPropagation().
|
private |
A pointer to the CredalNet to be used.
Definition at line 374 of file CNLoopyPropagation.h.
Referenced by gum::credal::CNLoopyPropagation< GUM_SCALAR >::CNLoopyPropagation().
|
private |
The choosen inference type.
nodeToNeighbours by Default.
Definition at line 371 of file CNLoopyPropagation.h.
Referenced by gum::credal::CNLoopyPropagation< GUM_SCALAR >::CNLoopyPropagation(), and gum::credal::CNLoopyPropagation< GUM_SCALAR >::inferenceType().
|
protected |
"Upper" information \( \Lambda \) coming from one's children.
Definition at line 351 of file CNLoopyPropagation.h.
|
protected |
"Lower" information \( \Lambda \) coming from one's children.
Definition at line 339 of file CNLoopyPropagation.h.
|
protected |
"Upper" information \( \pi \) coming from one's parent.
Definition at line 353 of file CNLoopyPropagation.h.
|
protected |
"Lower" information \( \pi \) coming from one's parent.
Definition at line 341 of file CNLoopyPropagation.h.
|
protectedinherited |
Number of iterations before checking stopping criteria.
Definition at line 414 of file approximationScheme.h.
Referenced by gum::GibbsSampling< GUM_SCALAR >::burnIn(), gum::GibbsBNdistance< GUM_SCALAR >::burnIn(), gum::ApproximationScheme::remainingBurnIn(), gum::GibbsSampling< GUM_SCALAR >::setBurnIn(), gum::GibbsBNdistance< GUM_SCALAR >::setBurnIn(), and gum::ApproximationScheme::startOfPeriod().
|
protectedinherited |
A pointer to the Credal Net used.
Definition at line 74 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcThreadDataCopy(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__verticesSampling(), gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpectations(), gum::credal::InferenceEngine< GUM_SCALAR >::_initExpectations(), gum::credal::InferenceEngine< GUM_SCALAR >::_initMarginals(), gum::credal::InferenceEngine< GUM_SCALAR >::_initMarginalSets(), gum::credal::InferenceEngine< GUM_SCALAR >::_repetitiveInit(), gum::credal::InferenceEngine< GUM_SCALAR >::_updateExpectations(), gum::credal::InferenceEngine< GUM_SCALAR >::credalNet(), gum::credal::InferenceEngine< GUM_SCALAR >::expectationMax(), gum::credal::InferenceEngine< GUM_SCALAR >::expectationMin(), gum::credal::InferenceEngine< GUM_SCALAR >::InferenceEngine(), gum::credal::InferenceEngine< GUM_SCALAR >::insertEvidence(), gum::credal::InferenceEngine< GUM_SCALAR >::insertEvidenceFile(), gum::credal::InferenceEngine< GUM_SCALAR >::insertModals(), gum::credal::InferenceEngine< GUM_SCALAR >::insertQuery(), gum::credal::InferenceEngine< GUM_SCALAR >::insertQueryFile(), gum::credal::InferenceEngine< GUM_SCALAR >::marginalMax(), gum::credal::InferenceEngine< GUM_SCALAR >::marginalMin(), gum::credal::InferenceEngine< GUM_SCALAR >::saveMarginals(), gum::credal::InferenceEngine< GUM_SCALAR >::saveVertices(), and gum::credal::InferenceEngine< GUM_SCALAR >::toString().
|
protectedinherited |
Current epsilon.
Definition at line 369 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), and gum::ApproximationScheme::initApproximationScheme().
|
protectedinherited |
Current rate.
Definition at line 375 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), and gum::ApproximationScheme::initApproximationScheme().
|
protectedinherited |
The current state.
Definition at line 384 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::_stopScheme(), gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::initApproximationScheme(), gum::ApproximationScheme::stateApproximationScheme(), and gum::ApproximationScheme::stopApproximationScheme().
|
protectedinherited |
The current step.
Definition at line 378 of file approximationScheme.h.
Referenced by gum::learning::Miic::_initiation(), gum::learning::Miic::_iteration(), gum::learning::Miic::_orientation_3off2(), gum::learning::Miic::_orientation_latents(), gum::learning::Miic::_orientation_miic(), gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::initApproximationScheme(), gum::learning::Miic::learnMixedStructure(), gum::ApproximationScheme::nbrIterations(), gum::ApproximationScheme::remainingBurnIn(), gum::ApproximationScheme::startOfPeriod(), and gum::ApproximationScheme::updateApproximationScheme().
|
protectedinherited |
Object used to efficiently store optimal bayes net during inference, for some algorithms.
Definition at line 147 of file inferenceEngine.h.
Referenced by gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_optFusion(), gum::credal::InferenceEngine< GUM_SCALAR >::getVarMod2BNsMap(), and gum::credal::InferenceEngine< GUM_SCALAR >::InferenceEngine().
|
protectedinherited |
Upper dynamic expectations.
If the network if not dynamic it's content is the same as _expectationMax.
Definition at line 101 of file inferenceEngine.h.
Referenced by gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpectations(), gum::credal::InferenceEngine< GUM_SCALAR >::dynamicExpMax(), gum::credal::InferenceEngine< GUM_SCALAR >::eraseAllEvidence(), and gum::credal::InferenceEngine< GUM_SCALAR >::saveExpectations().
|
protectedinherited |
Lower dynamic expectations.
If the network is not dynamic it's content is the same as _expectationMin.
Definition at line 98 of file inferenceEngine.h.
Referenced by gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpectations(), gum::credal::InferenceEngine< GUM_SCALAR >::dynamicExpMin(), gum::credal::InferenceEngine< GUM_SCALAR >::eraseAllEvidence(), and gum::credal::InferenceEngine< GUM_SCALAR >::saveExpectations().
|
protectedinherited |
If true, the threshold convergence is enabled.
Definition at line 393 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::disableEpsilon(), gum::ApproximationScheme::enableEpsilon(), gum::ApproximationScheme::isEnabledEpsilon(), and gum::ApproximationScheme::setEpsilon().
|
protectedinherited |
If true, the maximum iterations stopping criterion is enabled.
Definition at line 411 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::disableMaxIter(), gum::ApproximationScheme::enableMaxIter(), gum::ApproximationScheme::isEnabledMaxIter(), and gum::ApproximationScheme::setMaxIter().
|
protectedinherited |
If true, the timeout is enabled.
Definition at line 405 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::disableMaxTime(), gum::ApproximationScheme::enableMaxTime(), gum::ApproximationScheme::isEnabledMaxTime(), and gum::ApproximationScheme::setMaxTime().
|
protectedinherited |
If true, the minimal threshold for epsilon rate is enabled.
Definition at line 399 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::disableMinEpsilonRate(), gum::ApproximationScheme::enableMinEpsilonRate(), gum::ApproximationScheme::isEnabledMinEpsilonRate(), and gum::ApproximationScheme::setMinEpsilonRate().
|
protectedinherited |
Threshold for convergence.
Definition at line 390 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::epsilon(), and gum::ApproximationScheme::setEpsilon().
|
protectedinherited |
Holds observed variables states.
Definition at line 107 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__insertEvidence(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_optFusion(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_updateThread(), gum::credal::InferenceEngine< GUM_SCALAR >::eraseAllEvidence(), gum::credal::InferenceEngine< GUM_SCALAR >::insertEvidence(), and gum::credal::InferenceEngine< GUM_SCALAR >::insertEvidenceFile().
|
protectedinherited |
Upper expectations, if some variables modalities were inserted.
Definition at line 94 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcThreadDataCopy(), gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpectations(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_expFusion(), gum::credal::InferenceEngine< GUM_SCALAR >::_initExpectations(), gum::credal::InferenceEngine< GUM_SCALAR >::_updateExpectations(), and gum::credal::InferenceEngine< GUM_SCALAR >::expectationMax().
|
protectedinherited |
Lower expectations, if some variables modalities were inserted.
Definition at line 91 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcThreadDataCopy(), gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpectations(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_expFusion(), gum::credal::InferenceEngine< GUM_SCALAR >::_initExpectations(), gum::credal::InferenceEngine< GUM_SCALAR >::_updateExpectations(), and gum::credal::InferenceEngine< GUM_SCALAR >::expectationMin().
|
protectedinherited |
The scheme history, used only if verbosity == true.
Definition at line 387 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::history(), and gum::ApproximationScheme::initApproximationScheme().
|
protected |
TRUE
if inference has already been performed, FALSE
otherwise.
Definition at line 364 of file CNLoopyPropagation.h.
Referenced by gum::credal::CNLoopyPropagation< GUM_SCALAR >::CNLoopyPropagation(), and gum::credal::CNLoopyPropagation< GUM_SCALAR >::~CNLoopyPropagation().
|
protectedinherited |
Last epsilon value.
Definition at line 372 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme().
|
protectedinherited |
Upper marginals.
Definition at line 84 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcThreadDataCopy(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_computeEpsilon(), gum::credal::InferenceEngine< GUM_SCALAR >::_computeEpsilon(), gum::credal::InferenceEngine< GUM_SCALAR >::_initMarginals(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_initThreadsData(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_optFusion(), gum::credal::InferenceEngine< GUM_SCALAR >::_updateCredalSets(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_updateMarginals(), gum::credal::InferenceEngine< GUM_SCALAR >::marginalMax(), gum::credal::InferenceEngine< GUM_SCALAR >::saveMarginals(), and gum::credal::InferenceEngine< GUM_SCALAR >::toString().
|
protectedinherited |
Lower marginals.
Definition at line 82 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcThreadDataCopy(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_computeEpsilon(), gum::credal::InferenceEngine< GUM_SCALAR >::_computeEpsilon(), gum::credal::InferenceEngine< GUM_SCALAR >::_initMarginals(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_initThreadsData(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_optFusion(), gum::credal::InferenceEngine< GUM_SCALAR >::_updateCredalSets(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_updateMarginals(), gum::credal::InferenceEngine< GUM_SCALAR >::marginalMin(), gum::credal::InferenceEngine< GUM_SCALAR >::saveMarginals(), and gum::credal::InferenceEngine< GUM_SCALAR >::toString().
|
protectedinherited |
Credal sets vertices, if enabled.
Definition at line 87 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcThreadDataCopy(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_expFusion(), gum::credal::InferenceEngine< GUM_SCALAR >::_initMarginalSets(), gum::credal::InferenceEngine< GUM_SCALAR >::_updateCredalSets(), gum::credal::InferenceEngine< GUM_SCALAR >::saveVertices(), and gum::credal::InferenceEngine< GUM_SCALAR >::vertices().
|
protectedinherited |
The maximum iterations.
Definition at line 408 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::maxIter(), and gum::ApproximationScheme::setMaxIter().
|
protectedinherited |
The timeout.
Definition at line 402 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::maxTime(), and gum::ApproximationScheme::setMaxTime().
|
protectedinherited |
Threshold for the epsilon rate.
Definition at line 396 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::minEpsilonRate(), and gum::ApproximationScheme::setMinEpsilonRate().
|
protectedinherited |
Variables modalities used to compute expectations.
Definition at line 104 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcThreadDataCopy(), gum::credal::InferenceEngine< GUM_SCALAR >::_dynamicExpectations(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_expFusion(), gum::credal::InferenceEngine< GUM_SCALAR >::_initExpectations(), gum::credal::InferenceEngine< GUM_SCALAR >::_updateExpectations(), gum::credal::InferenceEngine< GUM_SCALAR >::insertModals(), gum::credal::InferenceEngine< GUM_SCALAR >::insertModalsFile(), and gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::makeInference().
|
protected |
Used to keep track of one's messages sent to it's parents.
Definition at line 336 of file CNLoopyPropagation.h.
Referenced by gum::credal::CNLoopyPropagation< GUM_SCALAR >::~CNLoopyPropagation().
|
protected |
"Upper" node information \( \Lambda \) obtained by combinaison of children messages.
Definition at line 356 of file CNLoopyPropagation.h.
|
protected |
"Lower" node information \( \Lambda \) obtained by combinaison of children messages.
Definition at line 344 of file CNLoopyPropagation.h.
|
protected |
"Upper" node information \( \pi \) obtained by combinaison of parent's messages.
Definition at line 360 of file CNLoopyPropagation.h.
|
protected |
"Lower" node information \( \pi \) obtained by combinaison of parent's messages.
Definition at line 348 of file CNLoopyPropagation.h.
|
protectedinherited |
Old upper marginals used to compute epsilon.
Definition at line 79 of file inferenceEngine.h.
Referenced by gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_computeEpsilon(), gum::credal::InferenceEngine< GUM_SCALAR >::_computeEpsilon(), gum::credal::InferenceEngine< GUM_SCALAR >::_initMarginals(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_initThreadsData(), and gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_updateOldMarginals().
|
protectedinherited |
Old lower marginals used to compute epsilon.
Definition at line 77 of file inferenceEngine.h.
Referenced by gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_computeEpsilon(), gum::credal::InferenceEngine< GUM_SCALAR >::_computeEpsilon(), gum::credal::InferenceEngine< GUM_SCALAR >::_initMarginals(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_initThreadsData(), and gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_updateOldMarginals().
|
protectedinherited |
Checking criteria frequency.
Definition at line 417 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::periodSize(), gum::ApproximationScheme::setPeriodSize(), and gum::ApproximationScheme::startOfPeriod().
|
protectedinherited |
Holds the query nodes states.
Definition at line 109 of file inferenceEngine.h.
Referenced by gum::credal::InferenceEngine< GUM_SCALAR >::eraseAllEvidence(), gum::credal::InferenceEngine< GUM_SCALAR >::insertQuery(), gum::credal::InferenceEngine< GUM_SCALAR >::insertQueryFile(), and gum::credal::InferenceEngine< GUM_SCALAR >::toString().
|
protectedinherited |
True
if using repetitive independence ( dynamic network only ), False
otherwise.
False
by default.
Definition at line 133 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__verticesSampling(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::CNMonteCarloSampling(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::makeInference(), gum::credal::InferenceEngine< GUM_SCALAR >::repetitiveInd(), and gum::credal::InferenceEngine< GUM_SCALAR >::setRepetitiveInd().
|
protectedinherited |
Iterations limit stopping rule used by some algorithms such as CNMonteCarloSampling.
The algorithms stops if no changes occured within 1000 iterations by default. int _iterStop; True
is optimal bayes net are stored, for each variable and each modality, False
otherwise. Not all algorithms offers this option. False
by default.
Definition at line 143 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcThreadDataCopy(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__verticesSampling(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_updateThread(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::CNMonteCarloSampling(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::eraseAllEvidence(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::makeInference(), and gum::credal::InferenceEngine< GUM_SCALAR >::storeBNOpt().
|
protectedinherited |
True
if credal sets vertices are stored, False
otherwise.
False
by default.
Definition at line 129 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcThreadDataCopy(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_expFusion(), gum::credal::InferenceEngine< GUM_SCALAR >::_initMarginalSets(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_updateThread(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::_verticesFusion(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::CNMonteCarloSampling(), gum::credal::MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine >::eraseAllEvidence(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::makeInference(), and gum::credal::InferenceEngine< GUM_SCALAR >::storeVertices().
|
protectedinherited |
Clusters of nodes used with dynamic networks.
Any node key in _t0 is present at \( t=0 \) and any node belonging to the node set of this key share the same CPT than the key. Used for sampling with repetitive independence.
Definition at line 117 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcThreadDataCopy(), gum::credal::InferenceEngine< GUM_SCALAR >::_repetitiveInit(), and gum::credal::InferenceEngine< GUM_SCALAR >::getT0Cluster().
|
protectedinherited |
Clusters of nodes used with dynamic networks.
Any node key in _t1 is present at \( t=1 \) and any node belonging to the node set of this key share the same CPT than the key. Used for sampling with repetitive independence.
Definition at line 124 of file inferenceEngine.h.
Referenced by gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__mcThreadDataCopy(), gum::credal::InferenceEngine< GUM_SCALAR >::_repetitiveInit(), and gum::credal::InferenceEngine< GUM_SCALAR >::getT1Cluster().
|
protectedinherited |
The timer.
Definition at line 381 of file approximationScheme.h.
Referenced by gum::learning::Miic::_initiation(), gum::learning::Miic::_iteration(), gum::learning::Miic::_orientation_3off2(), gum::learning::Miic::_orientation_latents(), gum::learning::Miic::_orientation_miic(), gum::ApproximationScheme::_stopScheme(), gum::ApproximationScheme::continueApproximationScheme(), gum::ApproximationScheme::currentTime(), gum::ApproximationScheme::initApproximationScheme(), and gum::learning::Miic::learnMixedStructure().
|
protectedinherited |
The number of time steps of this network (only usefull for dynamic networks).
Definition at line 154 of file inferenceEngine.h.
Referenced by gum::credal::InferenceEngine< GUM_SCALAR >::_repetitiveInit().
|
protected |
Used to keep track of which node needs to update it's information coming from it's children.
Definition at line 326 of file CNLoopyPropagation.h.
|
protected |
Used to keep track of which node needs to update it's information coming from it's parents.
Definition at line 322 of file CNLoopyPropagation.h.
|
protectedinherited |
If true, verbosity is enabled.
Definition at line 420 of file approximationScheme.h.
Referenced by gum::ApproximationScheme::setVerbosity(), and gum::ApproximationScheme::verbosity().
|
protected |
The current node-set to iterate through at this current step.
Definition at line 329 of file CNLoopyPropagation.h.
|
protected |
The next node-set, i.e.
the nodes that will send messages at the next step.
Definition at line 333 of file CNLoopyPropagation.h.
Progression, error and time.
Definition at line 59 of file IApproximationSchemeConfiguration.h.
Referenced by gum::learning::Miic::_initiation(), gum::learning::Miic::_iteration(), gum::learning::Miic::_orientation_3off2(), gum::learning::Miic::_orientation_latents(), gum::learning::Miic::_orientation_miic(), gum::ApproximationScheme::continueApproximationScheme(), and gum::learning::genericBNLearner::distributeProgress().
|
inherited |
Criteria messageApproximationScheme.
Definition at line 62 of file IApproximationSchemeConfiguration.h.
Referenced by gum::ApproximationScheme::_stopScheme(), and gum::learning::genericBNLearner::distributeStop().