Mixed Graphical Models with DGM

Semantic Image Segmentation with Conditional Random Fields

Mixed Graphical Models with DGM

Postby imyuliu » Fri Apr 14, 2017, 19:35

Hi Dr.,

I'm studying CRFs recently, and I've read some codes of implementations of general CRFs such as CRF(Java), Mallet, CRFSuite. I found DGM is best for me, which is quite clearly in coding.

During studying the codes written by you, I come across some questions and want to bother you:
  1. When adding/setting arcs in building a graph, why the edge potential is square rooted? (#186 and #196 in ./modules/DGM/Graph.cpp)
  2. In message passing algorithms, why the new msg is double multiplied by edge potential? (#80 in ./modules/DGM/MessagePassing.cpp)

I tried to search for clues that may help answering the questions, but found nothing. I hope you may give me some hints, and thank you.

Thank you.

User avatar
Posts: 125
Joined: Tue Dec 16, 2008, 21:52
Location: Hannover, Germany

Re: Mixed Graphical Models with DGM

Postby Creator » Fri Apr 14, 2017, 19:44


thank you for interest to the DGM library.
Here are the answers to your questions:

  1. The arc is the undirected edge in CRFs models. The DGM library emulates every undirected arc with two opposite-directed directed edges. Thus A -- B is represented with A -> B and A <- B. In the exact decoding, the potentials of every combination P(A, B) are calculated by multiplying node and edge potentials (please ref. to Demo 1D for more details: http://research.project-10.de/dgmdoc/a00020.html). Thus, when we have 2 edges, representing 1 arc, the potentials will be multiplied 2 times, instead of 1. That is the reason, why we extract the square root of the arc potential in addArc() and setArc() functions, but leave the edge potential unchanged in addEdge() and setEdge() functions. This allows the usage of both arcs and edges in the same model (like A -- B <- C)
  2. Since we work with potentials, which are not exact probabilities, we have a small degree of freedom here in interpreting the message passing algorithm. We calculate the square of the pairwise potentials (i.e. directed edges in DGM) in approximate message-passing algorithms in order to provide the back-compatibility with the exact inference/decoding algorithms.

I hope these answers will help you win understanding the DGM library. Please, do not hesitate turning to me, in case you have more questions.

Return to “Direct Graphical Models”

Who is online

Users browsing this forum: No registered users and 1 guest