UGM: Matlab code for undirected graphical models

Mark Schmidt (2007)

Summary

UGM is a set of Matlab functions implementing various tasks in probabilistic undirected graphical models of discrete data with pairwise (and unary) potentials. Specifically, it implements a variety of methods for the following four tasks: The first three tasks are implemented for arbitrary discrete undirected graphical models with pairwise potentials. The last task focuses on Markov random fields and conditional random fields with log-linear potentials. The code is written entirely in Matlab, although more efficient mex versions of some parts of the code are also available.


Available Methods

Decoding

UGM implements the following decoding methods: The corresponding functions are UGM_Decode_* (where * is the name of the method above).

Inference

UGM implements the following inference methods: The corresponding functions are UGM_Infer_* (where * is the name of the method above).

Sampling

UGM implements the following sampling methods: The corresponding functions are UGM_Sample_* (where * is the name of the method above).

Parameter Estimation

For parameter estimation, UGM uses a log-linear parameterization and allows training of Markov random fields or conditional random fields in the following scenarios:

How to use the code

The documentation for UGM consists of a series of demos, showing how to use UGM to perform various tasks. These demos also contain some tutorial material on undirected graphical models.

The first set of demos covers exact decoding/inference/sampling:

The second set of demos covers approximate decoding/inference/sampling methods: The third set of demos covers parameter estimation:

Download

The complete set of files for the 2011 version of UGM are available here (for parameter estimation, this package includes the 2009 versions of minFunc and minConf). For updates beyond the 2011 version, see the individual files below. To significantly speed up the decoding methods based on graph cuts (GraphCuts, AlphaBetaSwap, AlphaExpansion, AlphaExpansionBetaShrink), you can install the mex wrapper to the maxflow code into a sub-directory of the UGM directory.

To run the demos, in Matlab type:

cd UGM
addpath(genpath(pwd))
example_UGM_*
Where in the above * is the name of one of the demos. For example, to run the Small demo, type example_UGM_Small.

We have included mex files for several operating systems, but if you try to use the mex files on other operating systems you will get errors saying that a file is not found (where the file ends with 'C'). To compile the mex files for other operating systems, run the included mexAll function (then e-mail me the mex files so I can add them to the zip file for others to use). On some architectures the mexAll function does not seem to handle the directory structure properly, and in these cases you can compile the mex files by switching to the mex directory and directly using the mex function to compile the files in that directory.


Updates

2013

Here are updates that are not included in the 2011 version of UGM:

2012

Here are updates that are not included in the 2011 version of UGM:

2011

This is a major update to UGM. ALL mex files must be re-compiled to use this new version. In addition, parameter estimation now works in a completely different way to allow arbitrary parameter tying (there is no more infoStruct).

Below is the list of updates:

2009

Although the first line of code for UGM was written in 2007 and I included parts of it in previous packages (e.g. examples of using minFunc, examples of using L1General, Gsparse, and UGMlearn), the first complete and stand-alone version of UGM was released in 2009. Note that parameter estimation in this version works in a completely different way than the current version (while mex files from this older version may be incompatible with the newer version). This original version can still be downloaded here


UGM in Publications

I have used UGM in a few publications: To reference UGM in a publication, please include my name and a link to this website. You may also want to include the date, since I may update the software in the future.

If you have made a modification of UGM or added extra functionality (i.e. an alternate decoding method), please send it to me and I can include it here for others to use.


Mark Schmidt > Software > UGM