Expand description
TL <-> QuantrS2 hooks (PGM/message passing as reductions).
This crate provides integration between TensorLogic and probabilistic graphical models (PGMs). It maps belief propagation and other message passing algorithms onto einsum reduction patterns.
§Core Concepts
- Factor Graphs: Convert TLExpr predicates into factors
- Message Passing: Sum-product and max-product algorithms as tensor operations
- Inference: Marginalization and conditional queries via reductions
§Architecture
TLExpr → FactorGraph → MessagePassing → Marginals
↓ ↓ ↓ ↓
Predicates Factors Einsum Ops ProbabilitiesRe-exports§
pub use parameter_learning::BaumWelchLearner;pub use parameter_learning::BayesianEstimator;pub use parameter_learning::MaximumLikelihoodEstimator;pub use parameter_learning::SimpleHMM;pub use quantrs_hooks::DistributionExport;pub use quantrs_hooks::DistributionMetadata;pub use quantrs_hooks::ModelExport;pub use quantrs_hooks::ModelStatistics;pub use quantrs_hooks::QuantRSAssignment;pub use quantrs_hooks::QuantRSDistribution;pub use quantrs_hooks::QuantRSInferenceQuery;pub use quantrs_hooks::QuantRSModelExport;pub use quantrs_hooks::QuantRSParameterLearning;pub use quantrs_hooks::QuantRSSamplingHook;
Modules§
- parameter_
learning - Parameter learning algorithms for probabilistic graphical models.
- quantrs_
hooks - QuantRS2 integration hooks for probabilistic graphical models.
Structs§
- Bayesian
Network - Bayesian Network builder.
- Bethe
Approximation - Bethe approximation for structured variational inference.
- Clique
- A clique in the junction tree (a maximal set of connected variables).
- Conditional
Query - Query for conditional probability P(X | Y = y).
- Conditional
Random Field - Conditional Random Field builder (discriminative model for structured prediction).
- Convergence
Stats - Convergence statistics for belief propagation.
- Emission
Feature - Emission feature: fires when a specific label is paired with a specific observation.
- Expectation
Propagation - Expectation Propagation algorithm for approximate inference.
- Factor
- A factor in a probabilistic graphical model.
- Factor
Graph - Factor graph representation for PGM.
- Factor
Node - Factor node in a factor graph.
- GaussianEP
- Gaussian EP for continuous variables with moment matching.
- Gaussian
Site - Gaussian site approximation for continuous variables.
- Gibbs
Sampler - Gibbs sampling for approximate inference.
- Hidden
Markov Model - Hidden Markov Model builder.
- Identity
Feature - Simple identity feature: always returns 1.0
- Inference
Engine - Inference engine for PGM queries.
- Junction
Tree - Junction tree structure for exact inference.
- Junction
Tree Edge - Edge in the junction tree connecting two cliques.
- Linear
ChainCRF - Linear-chain CRF for sequence labeling.
- Marginalization
Query - Query for marginal probability P(X).
- Markov
Random Field - Markov Random Field builder (undirected graphical model).
- MaxProduct
Algorithm - Max-product algorithm (MAP inference).
- Mean
Field Inference - Mean-field variational inference.
- Separator
- A separator between two cliques (their shared variables).
- Site
- Site approximation for a single factor.
- SumProduct
Algorithm - Sum-product algorithm (belief propagation).
- Transition
Feature - Transition feature: fires when transitioning from one state to another.
- Tree
ReweightedBP - Tree-reweighted belief propagation (TRW-BP).
- Variable
Elimination - Variable elimination algorithm for exact inference.
- Variable
Node - Variable node in a factor graph.
Enums§
Traits§
- Feature
Function - Feature function for linear-chain CRF.
- Message
Passing Algorithm - Trait for message passing algorithms.
Functions§
- condition
- Compute conditional probability P(X | Y = y).
- expr_
to_ factor_ graph - Convert a TensorLogic expression to a factor graph.
- marginalize
- Compute marginal probability for a variable.
- message_
passing_ reduce - Perform message passing inference on a factor graph.
Type Aliases§
- Assignment
- Assignment of values to variables.
- Result
- Result type for PGM operations.