If you're interested in actual implementations, the website of the Probabilistic Programming Workshop offers an overview of actively developed languages:
I'm still confused. What exactly does a probabilistic programming language do differently than a normal one? Does it just have a lot of support for machine learning and representing data and stuff like that, or is there something fundamentally different?
A probabilistic programming language is probably better understood as a way to model stochastic processes. What I mean by modeling stochastic processes is we have data that we know was generated by some non-deterministic process. We also don't know all the parameters of this process. Probabilistic programming languages make the point that the best way to specify these processes is as programs. Once we do that, we can in a sense run these simulations in reverse to infer parameters in our models and even infer values for missing data.
It depends on your model - size and variables. If you have a moderately sized model with discrete variables you can infer values using exact algorithms (e.g. clique tree propagation, variable elimination, etc). If your model is too complex or has certain continuous distributions then you can use simulation techniques or other approximate algorithms.
Given that probabilistic graphical models is in general NP-hard (or #P-hard) then approximate algorithms are often used. However, for many problems discrete valued networks can be effectively managed with exact algorithms.
Some tools for exact inference (that are free or commercial with free versions) are:
That doesn't really change my definitions. I agree exact inference is intractable for anything but modest problem sizes. Luckily, I think most work these days is in making these systems use approximate inference.
Correct me if I'm wrong, conceptually, probabilistic programming does to equation solvers what declarative language like SQL do to query data.
Say you have a model, y = mx + b, and you have some data. Normally you can solve this explicitly with matrices or whatever. But you'll need to implement the solution. With probabilistic language like BUGS, you can feed in the model and the data and it would return `m` and `b` as a probability distribution.
This is an trivial example. One example of where it really comes in handy is doing bayesian inference.
A useful analogy is Prolog, which you can think of as a logical programming language. It has formal, logical rules as primitives, and the deductive inference search happens under the hood. Similarly, probabalistic programming languages have random variables and probability distributions as primitives and do probabalistic inference (usuallly Baysian) under the hood.
Probabilistic programming is not really "programming" as we might use the term without qualification. It's wholly focused on the specification of probabilistic models, their structure, data, and evaluation pattern.
Consider BUGS as it's a very prototypical probabilistic programming example. If your goal is to specify that you have a model where you observe the "wetness of the grass outside" and infer whether it "rained previously" then you can use BUGS to express it easily.
model {
rained ~ dbinom(0.1) /* prior probability */
for (i in 1:N) {
grass[i] ~ rained
}
}
for some data grass[i].
(That was a very sketchy example, don't read into it too closely)
The heart of this is that quantitative methods are getting so well understood that we can express the algebra of models as a formal language. When we do this we get many of the benefits that programming has done for formal expressions of flow-charts.
While the line isn't sharp, I would distinguish somewhat between older BUGS like languages, where the underlying analogy is typically a directed graph, and more recent probabilistic programming languages like Church, where the underlying analogy is an execution trace. The excitement around this newer form of probabilistic programming comes from the fact that they really are programming languages. Unlike BUGS, they inherit all the flexibility, composability, and encapsulation of the underlying language. Inference is viewed as sampling execution traces, so the connection with a programming language is quite tight.
And for a more theoretical, less interactive picture, here's a video of Noah Goodman, one of the creators of Church, at a Google tech talk discussing the language's philosophical foundations and showing a bunch of applications in cognitive science/psychology.
As a test dev, I'm really interested in this (and in inference engines/languages like Prolog). How can I write code that has the best chance of finding bugs that customers might care about? Short of wrapping humans in APIs (and I also love that), we can write tests that are different every time to try to avoid "stale" tests and approach the diversity that humans exhibit. Probabalistic computation has that built in! A lot of manager-types want a "repeatable" process but I'd like an "easily, know-ably mutable" one. One with known bounds even if the actual inputs/results weren't the same every time.
If your unit tests were automagically varied wouldn't that make them more valuable? They might actually find new bugs once in a while.
I'm uncertain from your description but have you heard of QuickCheck or http://www.cs.york.ac.uk/fp/smallcheck/ ? QuickCheck might be available in some form in your language.
One thing that's not entirely clear from the article is that probabilistic programming is Bayesian modeling and inference. Probabilistic programming isn't a new machine learning technique it's a more flexible way to do Bayesian statistics.
The new term "probabilistic programming" stems from the recognition that stochastic programs can be automatically interpreted as defining a joint probability model and Bayesian inference on this model equates to sampling execution traces that are consistent with the observed data. This is an extremely powerful idea. It enables one to quickly build and compose both the standard Bayesian models you'd find in textbooks, and innovate easily to build new models tailored to particular application domains, often by composing more standard models with more exotic ones. Probabilistic programming provides a natural way to specify these complex models and has the potential to hide the computational difficulties that plague applied Bayesian modeling.
Making all this practical is the real challenge. Performant sampling of execution traces for a broad class of models is an unsolved problem, which is part of the motivation for DARPA's new project.
For those interested in this area, we're working on one effort alone these lines at Sense: https://www.senseplatform.com.
I'm surprised the article suggested BUGS instead of JAGS. JAGS has pretty much all of the features of BUGS (except a GUI) and is open source, cross platform, faster, and easy to run batch jobs from the command line. I've been using JAGS pretty much everyday for the past 1.5 years for a research project I'm working on and have grown quite fond of it. Before that, I was using BUGS for 6 months and was in a living hell with how slow fitting models with it was. Since switching to JAGS, my productivity has increased by several orders of magnitude. I'm primarily using it for analyzing Markov Chain Monte Carlo models of behavioral data where standard nonlinear optimization techniques (such as MLE and MAP) are impossible to use.
20 comments
[ 0.30 ms ] story [ 26.9 ms ] threadhttp://probabilistic-programming.org/
http://research.microsoft.com/pubs/173887/model-learner-popl...
http://research.microsoft.com/en-us/projects/fun/
http://www.cs.tufts.edu/~nr/cs257/archive/avi-pfeffer/figaro...
Given that probabilistic graphical models is in general NP-hard (or #P-hard) then approximate algorithms are often used. However, for many problems discrete valued networks can be effectively managed with exact algorithms.
Some tools for exact inference (that are free or commercial with free versions) are:
http://genie.sis.pitt.edu http://www.norsys.com/netica.html http://www.hugin.com
Netica in particular has a large library of example networks.
Say you have a model, y = mx + b, and you have some data. Normally you can solve this explicitly with matrices or whatever. But you'll need to implement the solution. With probabilistic language like BUGS, you can feed in the model and the data and it would return `m` and `b` as a probability distribution.
This is an trivial example. One example of where it really comes in handy is doing bayesian inference.
Consider BUGS as it's a very prototypical probabilistic programming example. If your goal is to specify that you have a model where you observe the "wetness of the grass outside" and infer whether it "rained previously" then you can use BUGS to express it easily.
for some data grass[i].(That was a very sketchy example, don't read into it too closely)
The heart of this is that quantitative methods are getting so well understood that we can express the algebra of models as a formal language. When we do this we get many of the benefits that programming has done for formal expressions of flow-charts.
https://www.youtube.com/watch?v=fclvsoaUI-U
If your unit tests were automagically varied wouldn't that make them more valuable? They might actually find new bugs once in a while.
The new term "probabilistic programming" stems from the recognition that stochastic programs can be automatically interpreted as defining a joint probability model and Bayesian inference on this model equates to sampling execution traces that are consistent with the observed data. This is an extremely powerful idea. It enables one to quickly build and compose both the standard Bayesian models you'd find in textbooks, and innovate easily to build new models tailored to particular application domains, often by composing more standard models with more exotic ones. Probabilistic programming provides a natural way to specify these complex models and has the potential to hide the computational difficulties that plague applied Bayesian modeling.
Making all this practical is the real challenge. Performant sampling of execution traces for a broad class of models is an unsolved problem, which is part of the motivation for DARPA's new project.
For those interested in this area, we're working on one effort alone these lines at Sense: https://www.senseplatform.com.
Here's a link to JAGS's homepage: http://mcmc-jags.sourceforge.net/
There's also PyMC (which can do similar types of analysis). https://github.com/pymc-devs/pymc