Direct Graphical Models  v.1.5.1

Direct Graphical Models (DGM)

is a C++ dynamic link library implementing various tasks in probabilistic graphical models with pairwise dependencies. The library aims to be used for the Markov- and Conditional Random Fields (MRF / CRF), Markov Chains, Bayesian Networks, etc. DGM library consists of three modules:

These tasks are optimized for speed, i.e. high-efficient calculations. The code is written entirely in C++ and can be compiled with Microsoft Visual C++.

Methods Overview


DGM implements the following training methods:

Nodes | Unary Potentials

The corresponding classes are CTrainNode* (where * is the name of the method above). The difference between these methods is described at forum: Training of a Random Model.

Edges | Pairwise Potentials

The corresponding classes are CTrainEdge* (where * is the name of the method above).

Inference / Decode

DGM implements the following inference and decoding methods:


The corresponding classes are CInfer* (where * is the name of the method above).

All of the inference classes may be also used for approximate decoding via function DirectGraphicalModels::CInfer::decode()


The corresponding classes are CDecode* (where * is the name of the method above).

Parameter Estimation

DGM implements the following parameter estimation method:


DGM implements the following sampling method:

Feature Extraction

Please refer to the FEX Module documentation


Please refer to the VIS Module documentation

Quick Links

Sergey G. Kosov,