Are there any open-source implementations of MLNs in Java or C#? I'm particularly interested in an implementation that can do lazy inference.

asked Jul 01 '10 at 23:03

Wesley%20Tansey's gravatar image

Wesley Tansey


Jude Shavlik and his group at Wisconsin have a java implementation of MLN. I don't know whether they can send you a copy (they haven't officially released it yet), but you can ask Jude. It should have lazy inference. (Daniel can correct me if I am wrong.)

For Markov the Beast, check out this site. If you have question, you can ask the author Sebatian Riedel; he is a very nice guy. As Daniel said, cutting-plane inference is very similar to lazy inference; both avoid grounding the entire network upfront and only expand the set of active clauses as needed. That's the best bet for lazy inference in Java. The only problem is that it is only for MAP inference (learning is percetron). But if you are not looking for marginal inference, that should be good enough.

I have released some code for unsupervised semantic parsing, which is in Java (hence the confusion by Aria). The current Alchemy is indeed in C++. We have been conceiving a new version which probably would be written in Java, though that won't solve your problem any time soon.

(Jul 12 '10 at 17:19) Hoifung Poon

6 Answers:

There is a project called "markov thebeast". I don't know it personally, but it is written in Java. In general, you can find many open source machine learning software projects over at

answered Jul 02 '10 at 04:26

Mikio%20L%20Braun's gravatar image

Mikio L Braun

Thanks Mikio. I've seen MTB before, but it doesn't perform lazy inference (or any inference at all I believe). I think it's just a demo project for the author's network construction algorithm. It looks like mloss doesn't have any implementation either.

(Jul 02 '10 at 11:42) Wesley Tansey

MTB has inference algorithms, including cutting plane MAP inference. This is in some ways similar to lazy inference, since it doesn't instantiate all of the constraints. Some aspects of the package were designed with particular NLP applications in mind, but it has been used for other tasks as well.

Here's an example of large-scale activity recognition done with Markov thebeast:

(Jul 03 '10 at 00:54) Daniel Lowd

I think the most popular MLN implementation is Alchemy which is all in Java; it's released by Pedro Domingo's group at U. Washington. I'm pretty sure it does "lazy grounding" of atoms and it seems from the user guide that they've spent a lot of time trying to make their stuff easily usable. I'd give that a shot first.

answered Jul 02 '10 at 11:32

aria42's gravatar image


edited Jul 02 '10 at 11:33

Thanks aria42. I'm very familiar with Alchemy, and it would be great if it was in Java, but I'm afraid it's implemented in mostly C/C++.

(Jul 02 '10 at 11:42) Wesley Tansey

Whoops sorry about that. I know Hoifung Poon and know that he implements stuff in Java using/for Alchemy and I assumed the rest of the project was in that language.

(Jul 02 '10 at 11:57) aria42

I don't know of any. Best bet might be to write a Java/C# wrapper around Alchemy?

answered Jul 02 '10 at 17:35

Dave%20Moore's gravatar image

Dave Moore

In Java/Python there's also ProbCog, from the Technical University Munich.

They provide several algorithms to work with MLNs and BLNs. I haven't tested it yet, but their previous project (PyMLNs) was quite nice actually (although not as fast as Alchemy, obviously :) )

answered Jul 12 '10 at 21:39

Pedro%20Oliveira's gravatar image

Pedro Oliveira

edited Jul 12 '10 at 21:44


Thanks Pedro, I haven't seen ProbCog before. I'll check it out! :)

(Jul 13 '10 at 11:53) Wesley Tansey

Hi Pedro & Wesley,

Now I am doing a research to apply the MLN method to find dependency between root causes in industrial system. But I am very new to both MLN and the tools (Alchemy, ProbCog). I am also new to Linux, open source, programming, and Python. Is there any of you can guide me how to properly install & run the tools in Windows 7-32bit?

Thank you

(Aug 01 '13 at 13:30) Helmi Kurniawan

There are big list of toolkits

answered Aug 04 '10 at 10:35

yura's gravatar image


answered Apr 23 '12 at 01:50

Nikita%20Zhiltsov's gravatar image

Nikita Zhiltsov

Your answer
toggle preview

powered by OSQA

User submitted content is under Creative Commons: Attribution - Share Alike; Other things copyright (C) 2010, MetaOptimize LLC.