aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::ITI< AttributeSelection, isScalar > Class Template Reference

Learn a graphical representation of a function as a decision tree. More...

#include <agrum/FMDP/planning/FunctionGraph/iti.h>

+ Inheritance diagram for gum::ITI< AttributeSelection, isScalar >:
+ Collaboration diagram for gum::ITI< AttributeSelection, isScalar >:

Public Member Functions

Size size ()
 
Constructor & destructor.
 ITI (MultiDimFunctionGraph< double > *target, double attributeSelectionThreshold, Set< const DiscreteVariable * > attributeListe, const DiscreteVariable *learnedValue)
 ITI constructor for functions describing the behaviour of one variable according to a set of other variable such as conditionnal probabilities. More...
 
 ITI (MultiDimFunctionGraph< double > *target, double attributeSelectionThreshold, Set< const DiscreteVariable * > attributeListe)
 ITI constructeur for real functions. More...
 
 ~ITI ()
 Default destructor. More...
 
Visit Methods
NodeId root () const
 
bool isTerminal (NodeId ni) const
 
const DiscreteVariablenodeVar (NodeId ni) const
 
NodeId nodeSon (NodeId ni, Idx modality) const
 
Idx nodeNbObservation (NodeId ni) const
 
virtual void insertSetOfVars (MultiDimFunctionGraph< double > *ret) const
 

Protected Attributes

MultiDimFunctionGraph< double > * target_
 The final diagram we're building. More...
 
Set< const DiscreteVariable *> setOfVars_
 
const DiscreteVariablevalue_
 
Sequence< ValueTypevalueAssumed_
 
bool needUpdate_
 
Model handling datastructures
NodeGraphPart model_
 The source of nodeId. More...
 
NodeId root_
 The root of the ordered tree. More...
 
HashTable< NodeId, const DiscreteVariable *> nodeVarMap_
 Gives for any node its associated variable. More...
 
HashTable< NodeId, NodeId *> nodeSonsMap_
 A table giving for any node a table mapping to its son idx is the modality of associated variable. More...
 
HashTable< const DiscreteVariable *, LinkedList< NodeId > *> var2Node_
 Associates to any variable the list of all nodes associated to this variable. More...
 
HashTable< NodeId, NodeDatabase< AttributeSelection, isScalar > *> nodeId2Database_
 This hashtable binds every node to an associated NodeDatabase which handles every observation that concerns that node. More...
 
HashTable< NodeId, Set< const Observation *> *> leafDatabase_
 This hashtable binds to every leaf an associated set of all hte observations compatible with it. More...
 

Protected Member Functions

void insertSetOfVars_ (MultiDimFunctionGraph< double > *ret)
 insertSetOfVars_ More...
 

Graph Structure update methods

virtual void updateVar (const DiscreteVariable *)
 If a new modality appears to exists for given variable, call this method to turn every associated node to this variable into leaf. Graph has then indeed to be revised. More...
 
void updateNode_ (NodeId nody, Set< const DiscreteVariable * > &bestVars)
 From the given sets of node, selects randomly one and installs it on given node. More...
 
virtual void convertNode2Leaf_ (NodeId)
 Turns the given node into a leaf if not already so. More...
 
virtual void transpose_ (NodeId, const DiscreteVariable *)
 Installs given variable to the given node, ensuring that the variable is not present in its subtree. More...
 
virtual NodeId insertInternalNode_ (NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar, NodeId *sonsMap)
 inserts a new internal node in internal graph More...
 
virtual NodeId insertLeafNode_ (NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar, Set< const Observation * > *obsSet)
 inserts a new leaf node in internal graohs More...
 

New Observation insertion methods

void addObservation (const Observation *obs)
 Inserts a new observation. More...
 
void updateNodeWithObservation_ (const Observation *newObs, NodeId currentNodeId)
 Will update internal graph's NodeDatabase of given node with the new observation. More...
 

Graph Structure update methods

void updateGraph ()
 Updates the internal graph after a new observation has been added. More...
 
NodeId insertNode_ (NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar)
 inserts a new node in internal graph More...
 
void chgNodeBoundVar_ (NodeId chgedNodeId, const DiscreteVariable *desiredVar)
 Changes the associated variable of a node. More...
 
void removeNode_ (NodeId removedNodeId)
 Removes a node from the internal graph. More...
 

Function Graph Updating methods

void updateFunctionGraph ()
 Updates target to currently learned graph structure. More...
 
NodeId _insertNodeInFunctionGraph_ (NodeId src)
 Inserts an internal node in the target. More...
 
NodeId _insertTerminalNode_ (NodeId src)
 Insert a terminal node in the target. More...
 
NodeId _insertTerminalNode_ (NodeId src, Int2Type< true >)
 Insert a terminal node in the target. More...
 
NodeId _insertTerminalNode_ (NodeId src, Int2Type< false >)
 Insert a terminal node in the target. More...
 

Detailed Description

template<TESTNAME AttributeSelection, bool isScalar = false>
class gum::ITI< AttributeSelection, isScalar >

Learn a graphical representation of a function as a decision tree.

This learning is done incrementaly. Hence first observation are add to the structure and then the structure is updated. Maintains two graph function : one internal for the learning and a target which is updated on demand.

Definition at line 61 of file iti.h.

Constructor & Destructor Documentation

◆ ITI() [1/2]

template<TESTNAME AttributeSelection, bool isScalar>
gum::ITI< AttributeSelection, isScalar >::ITI ( MultiDimFunctionGraph< double > *  target,
double  attributeSelectionThreshold,
Set< const DiscreteVariable * >  attributeListe,
const DiscreteVariable learnedValue 
)

ITI constructor for functions describing the behaviour of one variable according to a set of other variable such as conditionnal probabilities.

Parameters
target: the MultiDimFunctionGraph in which we load the structure
attributeSelectionThreshold: threshold under which a node is not installed (pe-pruning)
attributeListe: Set of vars on which we rely to explain the behaviour of learned variable
learnedValue: the variable from which we try to learn the behaviour
target: the MultiDimFunctionGraph in which we load the structure
attributeSelectionThreshold: threshold under which a node is not installed (pe-pruning)
temporaryAPIfix: Issue in API in regard to IMDDI
attributeListe: Set of vars on which we rely to explain the behaviour of learned variable
learnedValue: the variable from which we try to learn the behaviour

Definition at line 61 of file iti_tpl.h.

References gum::Set< Key, Alloc >::emplace().

64  :
65  IncrementalGraphLearner< AttributeSelection, isScalar >(target, attributeListe, learnedValue),
66  _nbTotalObservation_(0), _attributeSelectionThreshold_(attributeSelectionThreshold) {
67  GUM_CONSTRUCTOR(ITI);
68  _staleTable_.insert(this->root_, false);
69  }
NodeId root_
The root of the ordered tree.
double _attributeSelectionThreshold_
The threshold above which we consider variables to be dependant.
Definition: iti.h:262
ITI(MultiDimFunctionGraph< double > *target, double attributeSelectionThreshold, Set< const DiscreteVariable * > attributeListe, const DiscreteVariable *learnedValue)
ITI constructor for functions describing the behaviour of one variable according to a set of other va...
Definition: iti_tpl.h:61
Idx _nbTotalObservation_
The total number of observation added to this tree.
Definition: iti.h:259
HashTable< NodeId, bool > _staleTable_
Hashtable indicating if given node has been modified (upon receiving new exemple or through a transpo...
Definition: iti.h:256
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
+ Here is the call graph for this function:

◆ ITI() [2/2]

template<TESTNAME AttributeSelection, bool isScalar>
gum::ITI< AttributeSelection, isScalar >::ITI ( MultiDimFunctionGraph< double > *  target,
double  attributeSelectionThreshold,
Set< const DiscreteVariable * >  attributeListe 
)

ITI constructeur for real functions.

We try to predict the output of a function f given a set of variable

Parameters
target: the MultiDimFunctionGraph in which we load the structure
attributeSelectionThreshold: threshold under which a node is not installed (pe-pruning)
attributeListe: Set of vars on which we rely to explain the behaviour of learned function

We try to predict the output of a function f given a set of variable

Parameters
target: the MultiDimFunctionGraph in which we load the structure
attributeSelectionThreshold: threshold under which a node is not installed (pe-pruning)
temporaryAPIfix: Issue in API in regard to IMDDI
attributeListeSetof vars on which we rely to explain the behaviour of learned function

Definition at line 84 of file iti_tpl.h.

References gum::Set< Key, Alloc >::emplace().

86  :
87  IncrementalGraphLearner< AttributeSelection, isScalar >(
88  target,
89  attributeListe,
90  new LabelizedVariable("Reward", "", 2)),
91  _nbTotalObservation_(0), _attributeSelectionThreshold_(attributeSelectionThreshold) {
92  GUM_CONSTRUCTOR(ITI);
93  _staleTable_.insert(this->root_, false);
94  }
NodeId root_
The root of the ordered tree.
double _attributeSelectionThreshold_
The threshold above which we consider variables to be dependant.
Definition: iti.h:262
ITI(MultiDimFunctionGraph< double > *target, double attributeSelectionThreshold, Set< const DiscreteVariable * > attributeListe, const DiscreteVariable *learnedValue)
ITI constructor for functions describing the behaviour of one variable according to a set of other va...
Definition: iti_tpl.h:61
Idx _nbTotalObservation_
The total number of observation added to this tree.
Definition: iti.h:259
HashTable< NodeId, bool > _staleTable_
Hashtable indicating if given node has been modified (upon receiving new exemple or through a transpo...
Definition: iti.h:256
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
+ Here is the call graph for this function:

◆ ~ITI()

template<TESTNAME AttributeSelection, bool isScalar = false>
gum::ITI< AttributeSelection, isScalar >::~ITI ( )
inline

Default destructor.

Definition at line 104 of file iti.h.

104  {
105  GUM_DESTRUCTOR(ITI);
106  ;
107  }
ITI(MultiDimFunctionGraph< double > *target, double attributeSelectionThreshold, Set< const DiscreteVariable * > attributeListe, const DiscreteVariable *learnedValue)
ITI constructor for functions describing the behaviour of one variable according to a set of other va...
Definition: iti_tpl.h:61

Member Function Documentation

◆ _insertNodeInFunctionGraph_()

template<TESTNAME AttributeSelection, bool isScalar>
NodeId gum::ITI< AttributeSelection, isScalar >::_insertNodeInFunctionGraph_ ( NodeId  currentNodeId)
private

Inserts an internal node in the target.

Parameters
srcthe source node in internal graph
Returns
the mathcing node id in the target
Parameters
thesource node in internal graph
Returns
the mathcing node id in the target

Definition at line 265 of file iti_tpl.h.

References gum::Set< Key, Alloc >::emplace().

265  {
266  if (this->nodeVarMap_[currentNodeId] == this->value_) {
267  NodeId nody = _insertTerminalNode_(currentNodeId);
268  return nody;
269  }
270 
271  if (!this->target_->variablesSequence().exists(this->nodeVarMap_[currentNodeId])) {
272  this->target_->add(*(this->nodeVarMap_[currentNodeId]));
273  }
274 
275  NodeId nody = this->target_->manager()->addInternalNode(this->nodeVarMap_[currentNodeId]);
276  for (Idx moda = 0; moda < this->nodeVarMap_[currentNodeId]->domainSize(); ++moda) {
277  NodeId son = this->_insertNodeInFunctionGraph_(this->nodeSonsMap_[currentNodeId][moda]);
278  this->target_->manager()->setSon(nody, moda, son);
279  }
280 
281  return nody;
282  }
void setSon(const NodeId &node, const Idx &modality, const NodeId &sonNode)
Sets nodes son for given modality to designated son node.
MultiDimFunctionGraph< double > * target_
The final diagram we&#39;re building.
NodeId addInternalNode(const DiscreteVariable *var)
Inserts a new non terminal node in graph.
virtual void add(const DiscreteVariable &v)
Adds a new var to the variables of the multidimensional matrix.
HashTable< NodeId, NodeId *> nodeSonsMap_
A table giving for any node a table mapping to its son idx is the modality of associated variable...
virtual const Sequence< const DiscreteVariable *> & variablesSequence() const override
Returns a const ref to the sequence of DiscreteVariable*.
HashTable< NodeId, const DiscreteVariable *> nodeVarMap_
Gives for any node its associated variable.
MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy > * manager()
Returns a const reference to the manager of this diagram.
NodeId _insertTerminalNode_(NodeId src)
Insert a terminal node in the target.
Definition: iti.h:209
NodeId _insertNodeInFunctionGraph_(NodeId src)
Inserts an internal node in the target.
Definition: iti_tpl.h:265
Size NodeId
Type for node ids.
Definition: graphElements.h:97
+ Here is the call graph for this function:

◆ _insertTerminalNode_() [1/3]

template<TESTNAME AttributeSelection, bool isScalar = false>
NodeId gum::ITI< AttributeSelection, isScalar >::_insertTerminalNode_ ( NodeId  src)
inlineprivate

Insert a terminal node in the target.

This function is a dispatcher that will call the right function according to the value of the template isScalar

Parameters
srcthe source node in the learned graph
Returns
the matching node in the target

Definition at line 209 of file iti.h.

209  {
210  return _insertTerminalNode_(src, Int2Type< isScalar >());
211  }
NodeId _insertTerminalNode_(NodeId src)
Insert a terminal node in the target.
Definition: iti.h:209

◆ _insertTerminalNode_() [2/3]

template<TESTNAME AttributeSelection, bool isScalar>
NodeId gum::ITI< AttributeSelection, isScalar >::_insertTerminalNode_ ( NodeId  currentNodeId,
Int2Type< true >   
)
private

Insert a terminal node in the target.

This function is called if we're learning a real value function. Inserts then a single value in target.

Parameters
srcthe source node in the learned graph
Returns
the matching node in the target

This function is called if we're learning the behaviour of a variable. Inserts then this variable and the relevant value beneath into target.

Parameters
thesource node in the learned graph
Returns
the matching node in the target

Definition at line 325 of file iti_tpl.h.

References gum::Set< Key, Alloc >::emplace().

326  {
327  double value = 0.0;
328  for (auto valIter = this->nodeId2Database_[currentNodeId]->cbeginValues();
329  valIter != this->nodeId2Database_[currentNodeId]->cendValues();
330  ++valIter) {
331  value += (double)valIter.key() * valIter.val();
332  }
333  if (this->nodeId2Database_[currentNodeId]->nbObservation())
334  value /= (double)this->nodeId2Database_[currentNodeId]->nbObservation();
335  NodeId nody = this->target_->manager()->addTerminalNode(value);
336  return nody;
337  }
MultiDimFunctionGraph< double > * target_
The final diagram we&#39;re building.
HashTable< NodeId, NodeDatabase< AttributeSelection, isScalar > *> nodeId2Database_
This hashtable binds every node to an associated NodeDatabase which handles every observation that co...
NodeId addTerminalNode(const GUM_SCALAR &value)
Adds a value to the MultiDimFunctionGraph.
MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy > * manager()
Returns a const reference to the manager of this diagram.
Size NodeId
Type for node ids.
Definition: graphElements.h:97
+ Here is the call graph for this function:

◆ _insertTerminalNode_() [3/3]

template<TESTNAME AttributeSelection, bool isScalar>
NodeId gum::ITI< AttributeSelection, isScalar >::_insertTerminalNode_ ( NodeId  currentNodeId,
Int2Type< false >   
)
private

Insert a terminal node in the target.

This function is called if we're learning the behaviour of a variable. Inserts then this variable and the relevant value beneath into target.

Parameters
srcthe source node in the learned graph
Returns
the matching node in the target

This function is called if we're learning a real value function. Inserts then a single value in target.

Parameters
thesource node in the learned graph
Returns
the matching node in the target

Definition at line 295 of file iti_tpl.h.

References gum::Set< Key, Alloc >::emplace().

296  {
297  if (!this->target_->variablesSequence().exists(this->value_))
298  this->target_->add(*(this->value_));
299 
300  Size tot = this->nodeId2Database_[currentNodeId]->nbObservation();
301  if (tot == Size(0)) return this->target_->manager()->addTerminalNode(0.0);
302 
303  NodeId* sonsMap
304  = static_cast< NodeId* >(SOA_ALLOCATE(sizeof(NodeId) * this->value_->domainSize()));
305  for (Idx modality = 0; modality < this->value_->domainSize(); ++modality) {
306  double newVal = 0.0;
307  newVal = (double)this->nodeId2Database_[currentNodeId]->effectif(modality) / (double)tot;
308  sonsMap[modality] = this->target_->manager()->addTerminalNode(newVal);
309  }
310  NodeId nody = this->target_->manager()->addInternalNode(this->value_, sonsMap);
311  return nody;
312  }
MultiDimFunctionGraph< double > * target_
The final diagram we&#39;re building.
NodeId addInternalNode(const DiscreteVariable *var)
Inserts a new non terminal node in graph.
virtual Size domainSize() const =0
virtual void add(const DiscreteVariable &v)
Adds a new var to the variables of the multidimensional matrix.
HashTable< NodeId, NodeDatabase< AttributeSelection, isScalar > *> nodeId2Database_
This hashtable binds every node to an associated NodeDatabase which handles every observation that co...
virtual const Sequence< const DiscreteVariable *> & variablesSequence() const override
Returns a const ref to the sequence of DiscreteVariable*.
NodeId addTerminalNode(const GUM_SCALAR &value)
Adds a value to the MultiDimFunctionGraph.
MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy > * manager()
Returns a const reference to the manager of this diagram.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:47
Size NodeId
Type for node ids.
Definition: graphElements.h:97
#define SOA_ALLOCATE(x)
+ Here is the call graph for this function:

◆ addObservation()

template<TESTNAME AttributeSelection, bool isScalar>
void gum::ITI< AttributeSelection, isScalar >::addObservation ( const Observation obs)
virtual

Inserts a new observation.

Parameters
obsthe new observation to learn
thenew observation to learn

Reimplemented from gum::IncrementalGraphLearner< AttributeSelection, isScalar >.

Definition at line 108 of file iti_tpl.h.

References gum::Set< Key, Alloc >::emplace().

108  {
111  }
Idx _nbTotalObservation_
The total number of observation added to this tree.
Definition: iti.h:259
virtual void addObservation(const Observation *obs)
Inserts a new observation.
+ Here is the call graph for this function:

◆ chgNodeBoundVar_()

template<TESTNAME AttributeSelection, bool isScalar>
void gum::ITI< AttributeSelection, isScalar >::chgNodeBoundVar_ ( NodeId  currentNodeId,
const DiscreteVariable desiredVar 
)
protectedvirtual

Changes the associated variable of a node.

Parameters
chgedNodeId: the node to change
desiredVar: its new associated variable

Reimplemented from gum::IncrementalGraphLearner< AttributeSelection, isScalar >.

Definition at line 220 of file iti_tpl.h.

References gum::Set< Key, Alloc >::emplace().

221  {
222  if (this->nodeVarMap_[currentNodeId] != desiredVar) {
223  _staleTable_[currentNodeId] = true;
225  desiredVar);
226  }
227  }
virtual void chgNodeBoundVar_(NodeId chgedNodeId, const DiscreteVariable *desiredVar)
Changes the associated variable of a node.
HashTable< NodeId, bool > _staleTable_
Hashtable indicating if given node has been modified (upon receiving new exemple or through a transpo...
Definition: iti.h:256
HashTable< NodeId, const DiscreteVariable *> nodeVarMap_
Gives for any node its associated variable.
+ Here is the call graph for this function:

◆ convertNode2Leaf_()

template<TESTNAME AttributeSelection, bool isScalar>
void gum::IncrementalGraphLearner< AttributeSelection, isScalar >::convertNode2Leaf_ ( NodeId  currentNodeId)
protectedvirtualinherited

Turns the given node into a leaf if not already so.

Definition at line 200 of file incrementalGraphLearner_tpl.h.

References gum::Set< Key, Alloc >::emplace().

201  {
202  if (nodeVarMap_[currentNodeId] != value_) {
203  leafDatabase_.insert(currentNodeId, new Set< const Observation* >());
204 
205  // Resolving potential sons issue
206  for (Idx modality = 0; modality < nodeVarMap_[currentNodeId]->domainSize(); ++modality) {
207  NodeId sonId = nodeSonsMap_[currentNodeId][modality];
208  convertNode2Leaf_(sonId);
209  (*leafDatabase_[currentNodeId]) = (*leafDatabase_[currentNodeId]) + *(leafDatabase_[sonId]);
210  removeNode_(sonId);
211  }
212 
213  SOA_DEALLOCATE(nodeSonsMap_[currentNodeId],
214  sizeof(NodeId) * nodeVarMap_[currentNodeId]->domainSize());
215  nodeSonsMap_.erase(currentNodeId);
216 
217  chgNodeBoundVar_(currentNodeId, value_);
218  }
219  }
virtual void convertNode2Leaf_(NodeId)
Turns the given node into a leaf if not already so.
void erase(const Key &key)
Removes a given element from the hash table.
#define SOA_DEALLOCATE(x, y)
virtual void removeNode_(NodeId removedNodeId)
Removes a node from the internal graph.
virtual void chgNodeBoundVar_(NodeId chgedNodeId, const DiscreteVariable *desiredVar)
Changes the associated variable of a node.
HashTable< NodeId, NodeId *> nodeSonsMap_
A table giving for any node a table mapping to its son idx is the modality of associated variable...
HashTable< NodeId, Set< const Observation *> *> leafDatabase_
This hashtable binds to every leaf an associated set of all hte observations compatible with it...
HashTable< NodeId, const DiscreteVariable *> nodeVarMap_
Gives for any node its associated variable.
Size NodeId
Type for node ids.
Definition: graphElements.h:97
+ Here is the call graph for this function:

◆ insertInternalNode_()

template<TESTNAME AttributeSelection, bool isScalar>
NodeId gum::IncrementalGraphLearner< AttributeSelection, isScalar >::insertInternalNode_ ( NodeDatabase< AttributeSelection, isScalar > *  nDB,
const DiscreteVariable boundVar,
NodeId sonsMap 
)
protectedvirtualinherited

inserts a new internal node in internal graph

Parameters
nDB: the associated database
boundVar: the associated variable
sonsMap: a table giving node's sons node
Returns
the newly created node's id

Definition at line 362 of file incrementalGraphLearner_tpl.h.

References gum::Set< Key, Alloc >::emplace().

365  {
366  NodeId newNodeId = this->insertNode_(nDB, boundVar);
367  nodeSonsMap_.insert(newNodeId, sonsMap);
368  return newNodeId;
369  }
virtual NodeId insertNode_(NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar)
inserts a new node in internal graph
HashTable< NodeId, NodeId *> nodeSonsMap_
A table giving for any node a table mapping to its son idx is the modality of associated variable...
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
Size NodeId
Type for node ids.
Definition: graphElements.h:97
+ Here is the call graph for this function:

◆ insertLeafNode_()

template<TESTNAME AttributeSelection, bool isScalar>
NodeId gum::IncrementalGraphLearner< AttributeSelection, isScalar >::insertLeafNode_ ( NodeDatabase< AttributeSelection, isScalar > *  nDB,
const DiscreteVariable boundVar,
Set< const Observation * > *  obsSet 
)
protectedvirtualinherited

inserts a new leaf node in internal graohs

Parameters
nDB: the associated database
boundVar: the associated variable
obsSet: the set of observation this leaf retains
Returns
the newly created node's id

Reimplemented in gum::IMDDI< AttributeSelection, isScalar >.

Definition at line 382 of file incrementalGraphLearner_tpl.h.

References gum::Set< Key, Alloc >::emplace().

385  {
386  NodeId newNodeId = this->insertNode_(nDB, boundVar);
387  leafDatabase_.insert(newNodeId, obsSet);
388  return newNodeId;
389  }
virtual NodeId insertNode_(NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar)
inserts a new node in internal graph
HashTable< NodeId, Set< const Observation *> *> leafDatabase_
This hashtable binds to every leaf an associated set of all hte observations compatible with it...
Size NodeId
Type for node ids.
Definition: graphElements.h:97
+ Here is the call graph for this function:

◆ insertNode_()

template<TESTNAME AttributeSelection, bool isScalar>
NodeId gum::ITI< AttributeSelection, isScalar >::insertNode_ ( NodeDatabase< AttributeSelection, isScalar > *  nDB,
const DiscreteVariable boundVar 
)
protectedvirtual

inserts a new node in internal graph

inserts a new node in internal graohs

Parameters
nDB: the associated database
boundVar: the associated variable
Returns
the newly created node's id

Reimplemented from gum::IncrementalGraphLearner< AttributeSelection, isScalar >.

Definition at line 203 of file iti_tpl.h.

References gum::Set< Key, Alloc >::emplace().

205  {
207  _staleTable_.insert(n, true);
208  return n;
209  }
virtual NodeId insertNode_(NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar)
inserts a new node in internal graph
HashTable< NodeId, bool > _staleTable_
Hashtable indicating if given node has been modified (upon receiving new exemple or through a transpo...
Definition: iti.h:256
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
Size NodeId
Type for node ids.
Definition: graphElements.h:97
+ Here is the call graph for this function:

◆ insertSetOfVars()

template<TESTNAME AttributeSelection, bool isScalar = false>
virtual void gum::IncrementalGraphLearner< AttributeSelection, isScalar >::insertSetOfVars ( MultiDimFunctionGraph< double > *  ret) const
inlinevirtualinherited

Implements gum::IVisitableGraphLearner.

Reimplemented in gum::IMDDI< AttributeSelection, isScalar >.

Definition at line 326 of file incrementalGraphLearner.h.

326  {
327  for (SetIteratorSafe< const DiscreteVariable* > varIter = setOfVars_.beginSafe();
328  varIter != setOfVars_.endSafe();
329  ++varIter)
330  ret->add(**varIter);
331  }
virtual void add(const DiscreteVariable &v)
Adds a new var to the variables of the multidimensional matrix.
Set< const DiscreteVariable *> setOfVars_

◆ insertSetOfVars_()

template<TESTNAME AttributeSelection, bool isScalar = false>
void gum::ITI< AttributeSelection, isScalar >::insertSetOfVars_ ( MultiDimFunctionGraph< double > *  ret)
inlineprotected

insertSetOfVars_

Parameters
ret

Definition at line 245 of file iti.h.

245  {
246  for (SetIteratorSafe< const DiscreteVariable* > varIter = this->setOfVars_.beginSafe();
247  varIter != this->setOfVars_.endSafe();
248  ++varIter)
249  ret->add(**varIter);
250  }
virtual void add(const DiscreteVariable &v)
Adds a new var to the variables of the multidimensional matrix.
Set< const DiscreteVariable *> setOfVars_

◆ isTerminal()

template<TESTNAME AttributeSelection, bool isScalar = false>
bool gum::IncrementalGraphLearner< AttributeSelection, isScalar >::isTerminal ( NodeId  ni) const
inlinevirtualinherited

Implements gum::IVisitableGraphLearner.

Definition at line 306 of file incrementalGraphLearner.h.

306 { return !this->nodeSonsMap_.exists(ni); }
bool exists(const Key &key) const
Checks whether there exists an element with a given key in the hashtable.
HashTable< NodeId, NodeId *> nodeSonsMap_
A table giving for any node a table mapping to its son idx is the modality of associated variable...

◆ nodeNbObservation()

template<TESTNAME AttributeSelection, bool isScalar = false>
Idx gum::IncrementalGraphLearner< AttributeSelection, isScalar >::nodeNbObservation ( NodeId  ni) const
inlinevirtualinherited

Implements gum::IVisitableGraphLearner.

Definition at line 321 of file incrementalGraphLearner.h.

321 { return this->nodeId2Database_[ni]->nbObservation(); }
HashTable< NodeId, NodeDatabase< AttributeSelection, isScalar > *> nodeId2Database_
This hashtable binds every node to an associated NodeDatabase which handles every observation that co...

◆ nodeSon()

template<TESTNAME AttributeSelection, bool isScalar = false>
NodeId gum::IncrementalGraphLearner< AttributeSelection, isScalar >::nodeSon ( NodeId  ni,
Idx  modality 
) const
inlinevirtualinherited

Implements gum::IVisitableGraphLearner.

Definition at line 316 of file incrementalGraphLearner.h.

316 { return this->nodeSonsMap_[ni][modality]; }
HashTable< NodeId, NodeId *> nodeSonsMap_
A table giving for any node a table mapping to its son idx is the modality of associated variable...

◆ nodeVar()

template<TESTNAME AttributeSelection, bool isScalar = false>
const DiscreteVariable* gum::IncrementalGraphLearner< AttributeSelection, isScalar >::nodeVar ( NodeId  ni) const
inlinevirtualinherited

Implements gum::IVisitableGraphLearner.

Definition at line 311 of file incrementalGraphLearner.h.

311 { return this->nodeVarMap_[ni]; }
HashTable< NodeId, const DiscreteVariable *> nodeVarMap_
Gives for any node its associated variable.

◆ removeNode_()

template<TESTNAME AttributeSelection, bool isScalar>
void gum::ITI< AttributeSelection, isScalar >::removeNode_ ( NodeId  currentNodeId)
protectedvirtual

Removes a node from the internal graph.

Parameters
removedNodeId: the node to remove

Reimplemented from gum::IncrementalGraphLearner< AttributeSelection, isScalar >.

Definition at line 237 of file iti_tpl.h.

References gum::Set< Key, Alloc >::emplace().

237  {
239  _staleTable_.erase(currentNodeId);
240  }
void erase(const Key &key)
Removes a given element from the hash table.
virtual void removeNode_(NodeId removedNodeId)
Removes a node from the internal graph.
HashTable< NodeId, bool > _staleTable_
Hashtable indicating if given node has been modified (upon receiving new exemple or through a transpo...
Definition: iti.h:256
+ Here is the call graph for this function:

◆ root()

template<TESTNAME AttributeSelection, bool isScalar = false>
NodeId gum::IncrementalGraphLearner< AttributeSelection, isScalar >::root ( ) const
inlinevirtualinherited

Implements gum::IVisitableGraphLearner.

Definition at line 301 of file incrementalGraphLearner.h.

301 { return this->root_; }
NodeId root_
The root of the ordered tree.

◆ size()

template<TESTNAME AttributeSelection, bool isScalar = false>
Size gum::IncrementalGraphLearner< AttributeSelection, isScalar >::size ( )
inlineinherited

Definition at line 290 of file incrementalGraphLearner.h.

290 { return nodeVarMap_.size(); }
HashTable< NodeId, const DiscreteVariable *> nodeVarMap_
Gives for any node its associated variable.

◆ transpose_()

template<TESTNAME AttributeSelection, bool isScalar>
void gum::IncrementalGraphLearner< AttributeSelection, isScalar >::transpose_ ( NodeId  currentNodeId,
const DiscreteVariable desiredVar 
)
protectedvirtualinherited

Installs given variable to the given node, ensuring that the variable is not present in its subtree.

Definition at line 227 of file incrementalGraphLearner_tpl.h.

References gum::Set< Key, Alloc >::emplace().

229  {
230  // **************************************************************************************
231  // Si le noeud courant contient déjà la variable qu'on souhaite lui amener
232  // Il n'y a rien à faire
233  if (nodeVarMap_[currentNodeId] == desiredVar) { return; }
234 
235  // **************************************************************************************
236  // Si le noeud courant est terminal,
237  // Il faut artificiellement insérer un noeud liant à la variable
238  if (nodeVarMap_[currentNodeId] == value_) {
239  // We turned this leaf into an internal node.
240  // This mean that we'll need to install children leaves for each value of
241  // desiredVar
242 
243  // First We must prepare these new leaves NodeDatabases and Sets<const
244  // Observation*>
245  NodeDatabase< AttributeSelection, isScalar >** dbMap
246  = static_cast< NodeDatabase< AttributeSelection, isScalar >** >(SOA_ALLOCATE(
247  sizeof(NodeDatabase< AttributeSelection, isScalar >*) * desiredVar->domainSize()));
248  Set< const Observation* >** obsetMap = static_cast< Set< const Observation* >** >(
249  SOA_ALLOCATE(sizeof(Set< const Observation* >*) * desiredVar->domainSize()));
250  for (Idx modality = 0; modality < desiredVar->domainSize(); ++modality) {
251  dbMap[modality] = new NodeDatabase< AttributeSelection, isScalar >(&setOfVars_, value_);
252  obsetMap[modality] = new Set< const Observation* >();
253  }
254  for (SetIteratorSafe< const Observation* > obsIter
255  = leafDatabase_[currentNodeId]->beginSafe();
256  leafDatabase_[currentNodeId]->endSafe() != obsIter;
257  ++obsIter) {
258  dbMap[_branchObs_(*obsIter, desiredVar)]->addObservation(*obsIter);
259  obsetMap[_branchObs_(*obsIter, desiredVar)]->insert(*obsIter);
260  }
261 
262  // Then we can install each new leaves (and put in place the sonsMap)
263  NodeId* sonsMap
264  = static_cast< NodeId* >(SOA_ALLOCATE(sizeof(NodeId) * desiredVar->domainSize()));
265  for (Idx modality = 0; modality < desiredVar->domainSize(); ++modality)
266  sonsMap[modality] = insertLeafNode_(dbMap[modality], value_, obsetMap[modality]);
267 
268  // Some necessary clean up
269  SOA_DEALLOCATE(dbMap,
270  sizeof(NodeDatabase< AttributeSelection, isScalar >*)
271  * desiredVar->domainSize());
272  SOA_DEALLOCATE(obsetMap, sizeof(Set< const Observation* >*) * desiredVar->domainSize());
273 
274  // And finally we can turn the node into an internal node associated to
275  // desiredVar
276  chgNodeBoundVar_(currentNodeId, desiredVar);
277  nodeSonsMap_.insert(currentNodeId, sonsMap);
278 
279  return;
280  }
281 
282  // *************************************************************************************
283  // Remains the general case where currentNodeId is an internal node.
284 
285  // First we ensure that children node use desiredVar as variable
286  for (Idx modality = 0; modality < nodeVarMap_[currentNodeId]->domainSize(); ++modality)
287  transpose_(nodeSonsMap_[currentNodeId][modality], desiredVar);
288 
289  // Sequence<NodeDatabase<AttributeSelection, isScalar>*>
290  // sonsNodeDatabase =
291  // nodeId2Database_[currentNodeId]->splitOnVar(desiredVar);
292  NodeId* sonsMap
293  = static_cast< NodeId* >(SOA_ALLOCATE(sizeof(NodeId) * desiredVar->domainSize()));
294 
295  // Then we create the new mapping
296  for (Idx desiredVarModality = 0; desiredVarModality < desiredVar->domainSize();
297  ++desiredVarModality) {
298  NodeId* grandSonsMap = static_cast< NodeId* >(
299  SOA_ALLOCATE(sizeof(NodeId) * nodeVarMap_[currentNodeId]->domainSize()));
300  NodeDatabase< AttributeSelection, isScalar >* sonDB
301  = new NodeDatabase< AttributeSelection, isScalar >(&setOfVars_, value_);
302  for (Idx currentVarModality = 0;
303  currentVarModality < nodeVarMap_[currentNodeId]->domainSize();
304  ++currentVarModality) {
305  grandSonsMap[currentVarModality]
306  = nodeSonsMap_[nodeSonsMap_[currentNodeId][currentVarModality]][desiredVarModality];
307  sonDB->operator+=((*nodeId2Database_[grandSonsMap[currentVarModality]]));
308  }
309 
310  sonsMap[desiredVarModality]
311  = insertInternalNode_(sonDB, nodeVarMap_[currentNodeId], grandSonsMap);
312  }
313 
314  // Finally we clean the old remaining nodes
315  for (Idx currentVarModality = 0; currentVarModality < nodeVarMap_[currentNodeId]->domainSize();
316  ++currentVarModality) {
317  removeNode_(nodeSonsMap_[currentNodeId][currentVarModality]);
318  }
319 
320  // We suppress the old sons map and remap to the new one
321  SOA_DEALLOCATE(nodeSonsMap_[currentNodeId],
322  sizeof(NodeId) * nodeVarMap_[currentNodeId]->domainSize());
323  nodeSonsMap_[currentNodeId] = sonsMap;
324 
325  chgNodeBoundVar_(currentNodeId, desiredVar);
326  }
virtual void removeNode_(NodeId removedNodeId)
Removes a node from the internal graph.
#define SOA_DEALLOCATE(x, y)
virtual NodeId insertInternalNode_(NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar, NodeId *sonsMap)
inserts a new internal node in internal graph
virtual void transpose_(NodeId, const DiscreteVariable *)
Installs given variable to the given node, ensuring that the variable is not present in its subtree...
Idx _branchObs_(const Observation *obs, const DiscreteVariable *var)
Seek modality assumed in obs for given var.
virtual void chgNodeBoundVar_(NodeId chgedNodeId, const DiscreteVariable *desiredVar)
Changes the associated variable of a node.
HashTable< NodeId, NodeDatabase< AttributeSelection, isScalar > *> nodeId2Database_
This hashtable binds every node to an associated NodeDatabase which handles every observation that co...
Set< const DiscreteVariable *> setOfVars_
HashTable< NodeId, NodeId *> nodeSonsMap_
A table giving for any node a table mapping to its son idx is the modality of associated variable...
HashTable< NodeId, Set< const Observation *> *> leafDatabase_
This hashtable binds to every leaf an associated set of all hte observations compatible with it...
HashTable< NodeId, const DiscreteVariable *> nodeVarMap_
Gives for any node its associated variable.
virtual NodeId insertLeafNode_(NodeDatabase< AttributeSelection, isScalar > *nDB, const DiscreteVariable *boundVar, Set< const Observation * > *obsSet)
inserts a new leaf node in internal graohs
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
Size NodeId
Type for node ids.
Definition: graphElements.h:97
#define SOA_ALLOCATE(x)
+ Here is the call graph for this function:

◆ updateFunctionGraph()

template<TESTNAME AttributeSelection, bool isScalar>
void gum::ITI< AttributeSelection, isScalar >::updateFunctionGraph ( )
virtual

Updates target to currently learned graph structure.

Implements gum::IncrementalGraphLearner< AttributeSelection, isScalar >.

Definition at line 251 of file iti_tpl.h.

References gum::Set< Key, Alloc >::emplace().

251  {
252  this->target_->clear();
254  }
void setRootNode(const NodeId &root)
Sets root node of decision diagram.
MultiDimFunctionGraph< double > * target_
The final diagram we&#39;re building.
NodeId root_
The root of the ordered tree.
MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy > * manager()
Returns a const reference to the manager of this diagram.
NodeId _insertNodeInFunctionGraph_(NodeId src)
Inserts an internal node in the target.
Definition: iti_tpl.h:265
void clear()
Clears the function graph.
+ Here is the call graph for this function:

◆ updateGraph()

template<TESTNAME AttributeSelection, bool isScalar>
void gum::ITI< AttributeSelection, isScalar >::updateGraph ( )
virtual

Updates the internal graph after a new observation has been added.

Implements gum::IncrementalGraphLearner< AttributeSelection, isScalar >.

Definition at line 139 of file iti_tpl.h.

References gum::Set< Key, Alloc >::emplace().

139  {
140  std::vector< NodeId > filo;
141  filo.push_back(this->root_);
142  HashTable< NodeId, Set< const DiscreteVariable* >* > potentialVars;
143  potentialVars.insert(this->root_, new Set< const DiscreteVariable* >(this->setOfVars_));
144 
145 
146  while (!filo.empty()) {
147  NodeId currentNodeId = filo.back();
148  filo.pop_back();
149 
150  // First we look for the best var to install on the node
151  double bestValue = _attributeSelectionThreshold_;
152  Set< const DiscreteVariable* > bestVars;
153 
154  for (auto varIter = potentialVars[currentNodeId]->cbeginSafe();
155  varIter != potentialVars[currentNodeId]->cendSafe();
156  ++varIter)
157  if (this->nodeId2Database_[currentNodeId]->isTestRelevant(*varIter)) {
158  double varValue = this->nodeId2Database_[currentNodeId]->testValue(*varIter);
159  if (varValue >= bestValue) {
160  if (varValue > bestValue) {
161  bestValue = varValue;
162  bestVars.clear();
163  }
164  bestVars.insert(*varIter);
165  }
166  }
167 
168  // Then We installed Variable a test on that node
169  this->updateNode_(currentNodeId, bestVars);
170 
171  // The we move on the children if needed
172  if (this->nodeVarMap_[currentNodeId] != this->value_) {
173  for (Idx moda = 0; moda < this->nodeVarMap_[currentNodeId]->domainSize(); moda++) {
174  Set< const DiscreteVariable* >* itsPotentialVars
175  = new Set< const DiscreteVariable* >(*potentialVars[currentNodeId]);
176  itsPotentialVars->erase(this->nodeVarMap_[currentNodeId]);
177  NodeId sonId = this->nodeSonsMap_[currentNodeId][moda];
178  if (_staleTable_[sonId]) {
179  filo.push_back(sonId);
180  potentialVars.insert(sonId, itsPotentialVars);
181  }
182  }
183  }
184  }
185 
186  for (HashTableIteratorSafe< NodeId, Set< const DiscreteVariable* >* > nodeIter
187  = potentialVars.beginSafe();
188  nodeIter != potentialVars.endSafe();
189  ++nodeIter)
190  delete nodeIter.val();
191  }
void updateNode_(NodeId nody, Set< const DiscreteVariable * > &bestVars)
From the given sets of node, selects randomly one and installs it on given node.
NodeId root_
The root of the ordered tree.
double _attributeSelectionThreshold_
The threshold above which we consider variables to be dependant.
Definition: iti.h:262
HashTable< NodeId, NodeDatabase< AttributeSelection, isScalar > *> nodeId2Database_
This hashtable binds every node to an associated NodeDatabase which handles every observation that co...
Set< const DiscreteVariable *> setOfVars_
HashTable< NodeId, NodeId *> nodeSonsMap_
A table giving for any node a table mapping to its son idx is the modality of associated variable...
HashTable< NodeId, bool > _staleTable_
Hashtable indicating if given node has been modified (upon receiving new exemple or through a transpo...
Definition: iti.h:256
HashTable< NodeId, const DiscreteVariable *> nodeVarMap_
Gives for any node its associated variable.
Size NodeId
Type for node ids.
Definition: graphElements.h:97
+ Here is the call graph for this function:

◆ updateNode_()

template<TESTNAME AttributeSelection, bool isScalar>
void gum::IncrementalGraphLearner< AttributeSelection, isScalar >::updateNode_ ( NodeId  updatedNode,
Set< const DiscreteVariable * > &  varsOfInterest 
)
protectedinherited

From the given sets of node, selects randomly one and installs it on given node.

Chechks of course if node's current variable is not in that set first.

Parameters
nody: the node we update
bestVars: the set of interessting vars to be installed here

Chechks of course if node's current variable is not in that set first.

Parameters
nody: the node we update
bestVar: the set of interessting vars to be installed here

Definition at line 169 of file incrementalGraphLearner_tpl.h.

References gum::Set< Key, Alloc >::emplace().

171  {
172  // If this node has no interesting variable, we turn it into a leaf
173  if (varsOfInterest.empty()) {
174  convertNode2Leaf_(updatedNode);
175  return;
176  }
177 
178  // If this node has already one of the best variable intalled as test, we
179  // move on
180  if (nodeVarMap_.exists(updatedNode) && varsOfInterest.exists(nodeVarMap_[updatedNode])) {
181  return;
182  }
183 
184  // In any other case we have to install variable as best test
185  Idx randy = (Idx)(std::rand() / RAND_MAX) * varsOfInterest.size(), basc = 0;
186  SetConstIteratorSafe< const DiscreteVariable* > varIter;
187  for (varIter = varsOfInterest.cbeginSafe(), basc = 0;
188  varIter != varsOfInterest.cendSafe() && basc < randy;
189  ++varIter, basc++)
190  ;
191 
192  transpose_(updatedNode, *varIter);
193  }
virtual void convertNode2Leaf_(NodeId)
Turns the given node into a leaf if not already so.
virtual void transpose_(NodeId, const DiscreteVariable *)
Installs given variable to the given node, ensuring that the variable is not present in its subtree...
HashTable< NodeId, const DiscreteVariable *> nodeVarMap_
Gives for any node its associated variable.
Size Idx
Type for indexes.
Definition: types.h:52
+ Here is the call graph for this function:

◆ updateNodeWithObservation_()

template<TESTNAME AttributeSelection, bool isScalar>
void gum::ITI< AttributeSelection, isScalar >::updateNodeWithObservation_ ( const Observation newObs,
NodeId  currentNodeId 
)
protectedvirtual

Will update internal graph's NodeDatabase of given node with the new observation.

Parameters
newObs
currentNodeId

Reimplemented from gum::IncrementalGraphLearner< AttributeSelection, isScalar >.

Definition at line 122 of file iti_tpl.h.

References gum::Set< Key, Alloc >::emplace().

123  {
125  newObs,
126  currentNodeId);
127  _staleTable_[currentNodeId] = true;
128  }
HashTable< NodeId, bool > _staleTable_
Hashtable indicating if given node has been modified (upon receiving new exemple or through a transpo...
Definition: iti.h:256
virtual void updateNodeWithObservation_(const Observation *newObs, NodeId currentNodeId)
Will update internal graph&#39;s NodeDatabase of given node with the new observation. ...
+ Here is the call graph for this function:

◆ updateVar()

template<TESTNAME AttributeSelection, bool isScalar>
void gum::IncrementalGraphLearner< AttributeSelection, isScalar >::updateVar ( const DiscreteVariable var)
virtualinherited

If a new modality appears to exists for given variable, call this method to turn every associated node to this variable into leaf. Graph has then indeed to be revised.

Definition at line 147 of file incrementalGraphLearner_tpl.h.

References gum::Set< Key, Alloc >::emplace().

148  {
149  Link< NodeId >* nodIter = var2Node_[var]->list();
150  Link< NodeId >* nni = nullptr;
151  while (nodIter) {
152  nni = nodIter->nextLink();
153  convertNode2Leaf_(nodIter->element());
154  nodIter = nni;
155  }
156  }
virtual void convertNode2Leaf_(NodeId)
Turns the given node into a leaf if not already so.
HashTable< const DiscreteVariable *, LinkedList< NodeId > *> var2Node_
Associates to any variable the list of all nodes associated to this variable.
+ Here is the call graph for this function:

Member Data Documentation

◆ _attributeSelectionThreshold_

template<TESTNAME AttributeSelection, bool isScalar = false>
double gum::ITI< AttributeSelection, isScalar >::_attributeSelectionThreshold_
private

The threshold above which we consider variables to be dependant.

Definition at line 262 of file iti.h.

◆ _nbTotalObservation_

template<TESTNAME AttributeSelection, bool isScalar = false>
Idx gum::ITI< AttributeSelection, isScalar >::_nbTotalObservation_
private

The total number of observation added to this tree.

Definition at line 259 of file iti.h.

◆ _staleTable_

template<TESTNAME AttributeSelection, bool isScalar = false>
HashTable< NodeId, bool > gum::ITI< AttributeSelection, isScalar >::_staleTable_
private

Hashtable indicating if given node has been modified (upon receiving new exemple or through a transpose) The aim is not if we have revise the installed variable on that node.

Definition at line 256 of file iti.h.

◆ leafDatabase_

template<TESTNAME AttributeSelection, bool isScalar = false>
HashTable< NodeId, Set< const Observation* >* > gum::IncrementalGraphLearner< AttributeSelection, isScalar >::leafDatabase_
protectedinherited

This hashtable binds to every leaf an associated set of all hte observations compatible with it.

Definition at line 379 of file incrementalGraphLearner.h.

◆ model_

template<TESTNAME AttributeSelection, bool isScalar = false>
NodeGraphPart gum::IncrementalGraphLearner< AttributeSelection, isScalar >::model_
protectedinherited

The source of nodeId.

Definition at line 345 of file incrementalGraphLearner.h.

◆ needUpdate_

template<TESTNAME AttributeSelection, bool isScalar = false>
bool gum::IncrementalGraphLearner< AttributeSelection, isScalar >::needUpdate_
protectedinherited

Definition at line 392 of file incrementalGraphLearner.h.

◆ nodeId2Database_

template<TESTNAME AttributeSelection, bool isScalar = false>
HashTable< NodeId, NodeDatabase< AttributeSelection, isScalar >* > gum::IncrementalGraphLearner< AttributeSelection, isScalar >::nodeId2Database_
protectedinherited

This hashtable binds every node to an associated NodeDatabase which handles every observation that concerns that node.

Definition at line 373 of file incrementalGraphLearner.h.

◆ nodeSonsMap_

template<TESTNAME AttributeSelection, bool isScalar = false>
HashTable< NodeId, NodeId* > gum::IncrementalGraphLearner< AttributeSelection, isScalar >::nodeSonsMap_
protectedinherited

A table giving for any node a table mapping to its son idx is the modality of associated variable.

Definition at line 361 of file incrementalGraphLearner.h.

◆ nodeVarMap_

template<TESTNAME AttributeSelection, bool isScalar = false>
HashTable< NodeId, const DiscreteVariable* > gum::IncrementalGraphLearner< AttributeSelection, isScalar >::nodeVarMap_
protectedinherited

Gives for any node its associated variable.

Definition at line 355 of file incrementalGraphLearner.h.

◆ root_

template<TESTNAME AttributeSelection, bool isScalar = false>
NodeId gum::IncrementalGraphLearner< AttributeSelection, isScalar >::root_
protectedinherited

The root of the ordered tree.

Definition at line 350 of file incrementalGraphLearner.h.

◆ setOfVars_

template<TESTNAME AttributeSelection, bool isScalar = false>
Set< const DiscreteVariable* > gum::IncrementalGraphLearner< AttributeSelection, isScalar >::setOfVars_
protectedinherited

Definition at line 387 of file incrementalGraphLearner.h.

◆ target_

template<TESTNAME AttributeSelection, bool isScalar = false>
MultiDimFunctionGraph< double >* gum::IncrementalGraphLearner< AttributeSelection, isScalar >::target_
protectedinherited

The final diagram we're building.

Definition at line 385 of file incrementalGraphLearner.h.

◆ value_

template<TESTNAME AttributeSelection, bool isScalar = false>
const DiscreteVariable* gum::IncrementalGraphLearner< AttributeSelection, isScalar >::value_
protectedinherited

Definition at line 389 of file incrementalGraphLearner.h.

◆ valueAssumed_

template<TESTNAME AttributeSelection, bool isScalar = false>
Sequence< ValueType > gum::IncrementalGraphLearner< AttributeSelection, isScalar >::valueAssumed_
protectedinherited

Definition at line 390 of file incrementalGraphLearner.h.

◆ var2Node_

template<TESTNAME AttributeSelection, bool isScalar = false>
HashTable< const DiscreteVariable*, LinkedList< NodeId >* > gum::IncrementalGraphLearner< AttributeSelection, isScalar >::var2Node_
protectedinherited

Associates to any variable the list of all nodes associated to this variable.

Definition at line 367 of file incrementalGraphLearner.h.


The documentation for this class was generated from the following files: