Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

DiscreteLookupDAG

Max-product produces an MPE (maximum probability explanation), which GTSAM represents with a DiscreteLookupDAG. Its DiscreteLookupTable conditionals record the maximizing frontal value for every parent assignment, allowing the MPE assignment to be recovered with argmax().

Open In Colab

Creating a lookup DAG

Users normally obtain the DAG from DiscreteFactorGraph.maxProduct(). Constructing DiscreteLookupTable directly requires the internal algebraic decision tree, which is intentionally not part of the high-level Python API.

DiscreteLookupDAG.argmax()

With no arguments, argmax() back-substitutes through every table and returns the global maximum-product assignment. Its optional given argument supplies values for parent variables outside the DAG; variables solved by the DAG are written during back-substitution.

DiscreteLookupTable

at(i) returns an individual table. It is a DiscreteConditional, so nrFrontals(), nrParents(), keys(), and argmax(parent_values) describe the local decision rule. The DAG owns these tables; retain the DAG while inspecting them.

Source

DiscreteLookupDAG.h

AI assistance caveat

AI was used to help draft this documentation, and inaccuracies could be present.