The inference
module provides the foundational classes and algorithms for probabilistic graphical models in GTSAM, focusing on variable elimination and the resulting structures like Bayes Nets and Bayes Trees.
Core Concepts¶
- Key: Base type (
uint64_t
) for uniquely identifying variables. - Symbol: A Key type encoding a character and an index (e.g.,
x0
). - LabeledSymbol: A
Symbol
variant with an additional label character, useful for multi-robot scenarios (e.g.,xA0
). - EdgeKey: A Key type encoding a pair of 32-bit integers.
- Factor: Abstract base class for all factors (relationships between variables).
- FactorGraph: Base class representing a collection of factors.
- Conditional: Abstract base class for conditional distributions/densities resulting from elimination ( ).
Elimination Algorithms & Control¶
- Ordering: Specifies the order in which variables are eliminated, crucial for efficiency.
- VariableIndex: Maps variables to the factors they appear in, used for efficient elimination ordering and construction.
- EliminateableFactorGraph: A mixin class providing
eliminateSequential
andeliminateMultifrontal
methods to concrete factor graph types (likeGaussianFactorGraph
,SymbolicFactorGraph
).
Elimination Results & Structures¶
- BayesNet: Represents the result of sequential variable elimination as a directed acyclic graph (DAG) of conditionals.
- EliminationTree: Tree structure representing the dependencies and computations during sequential elimination.
- ClusterTree: Base class for tree structures where nodes are clusters of factors (e.g., JunctionTree).
- JunctionTree: A cluster tree representing the cliques formed during multifrontal elimination, holding the factors before they are eliminated into conditionals.
- BayesTreeCliqueBase: Abstract base class for the nodes (cliques) within a BayesTree.
- BayesTree: Represents the result of multifrontal variable elimination as a tree of cliques, where each clique contains the conditional .
Incremental Inference¶
- ISAM: Incremental Smoothing and Mapping algorithm based on updating a BayesTree (original version, often superseded by ISAM2 in
nonlinear
).
Visualization¶
- DotWriter: Helper class to customize the generation of Graphviz
.dot
files for visualizing graphs and trees.